src/HOL/Multivariate_Analysis/Path_Connected.thy
author nipkow
Tue, 17 Nov 2015 12:01:19 +0100
changeset 61693 f6b9f528c89c
parent 61518 ff12606337e9
child 61694 6571c78c9667
permissions -rw-r--r--
converted lookup to cmp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
41959
b460124855b8 tuned headers;
wenzelm
parents: 39302
diff changeset
     1
(*  Title:      HOL/Multivariate_Analysis/Path_Connected.thy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
     2
    Author:     Robert Himmelmann, TU Muenchen, and LCP with 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
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
     8
imports Convex_Euclidean_Space
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
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    11
(*FIXME move up?*)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    12
lemma image_affinity_interval:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    13
  fixes c :: "'a::ordered_real_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    14
  shows "((\<lambda>x. m *\<^sub>R x + c) ` {a..b}) = (if {a..b}={} then {}
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    15
            else if 0 <= m then {m *\<^sub>R a + c .. m  *\<^sub>R b + c}
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    16
            else {m *\<^sub>R b + c .. m *\<^sub>R a + c})"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    17
  apply (case_tac "m=0", force)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    18
  apply (auto simp: scaleR_left_mono)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    19
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: pos_le_divideR_eq le_diff_eq scaleR_left_mono_neg)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    20
  apply (metis diff_le_eq inverse_inverse_eq order.not_eq_order_implies_strict pos_le_divideR_eq positive_imp_inverse_positive)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    21
  apply (rule_tac x="inverse m *\<^sub>R (x-c)" in rev_image_eqI, auto simp: not_le neg_le_divideR_eq diff_le_eq)
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    22
  using le_diff_eq scaleR_le_cancel_left_neg
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    23
  apply fastforce
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    24
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    25
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
    26
subsection \<open>Paths and Arcs\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    27
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    28
definition path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    29
  where "path g \<longleftrightarrow> continuous_on {0..1} g"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    30
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    31
definition pathstart :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    32
  where "pathstart g = g 0"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    33
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    34
definition pathfinish :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> 'a"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    35
  where "pathfinish g = g 1"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    36
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    37
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
    38
  where "path_image g = g ` {0 .. 1}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    39
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    40
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
    41
  where "reversepath g = (\<lambda>x. g(1 - x))"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    42
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
    43
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
    44
    (infixr "+++" 75)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    45
  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
    46
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    47
definition simple_path :: "(real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
    48
  where "simple_path g \<longleftrightarrow>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    49
     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
    50
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    51
definition arc :: "(real \<Rightarrow> 'a :: topological_space) \<Rightarrow> bool"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    52
  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
    53
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
    54
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
    55
subsection\<open>Invariance theorems\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    56
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    57
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
    58
  using continuous_on_eq path_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    59
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    60
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
    61
  unfolding path_def path_image_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    62
  using continuous_on_compose by blast
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_translation_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    65
  fixes g :: "real \<Rightarrow> 'a :: real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    66
  shows "path((\<lambda>x. a + x) o g) = path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    67
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    68
  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
    69
    by (rule ext) simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    70
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    71
    unfolding path_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    72
    apply safe
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    73
    apply (subst g)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    74
    apply (rule continuous_on_compose)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    75
    apply (auto intro: continuous_intros)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    76
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    77
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    78
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    79
lemma path_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    80
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    81
   assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    82
     shows "path(f o g) = path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    83
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    84
  from linear_injective_left_inverse [OF assms]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    85
  obtain h where h: "linear h" "h \<circ> f = id"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    86
    by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    87
  then have g: "g = h o (f o g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    88
    by (metis comp_assoc id_comp)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    89
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    90
    unfolding path_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    91
    using h assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
    92
    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
    93
qed
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 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
    96
  by (simp add: pathstart_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 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
    99
  by (simp add: pathstart_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   100
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   101
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
   102
  by (simp add: pathfinish_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 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
   105
  by (simp add: pathfinish_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   106
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   107
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
   108
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   109
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   110
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
   111
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   112
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   113
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
   114
  by (rule ext) (simp add: reversepath_def)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   115
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   116
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
   117
  by (rule ext) (simp add: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   118
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   119
lemma joinpaths_translation:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   120
    "((\<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
   121
  by (rule ext) (simp add: joinpaths_def)
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 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
   124
  by (rule ext) (simp add: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   125
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   126
lemma simple_path_translation_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   127
  fixes g :: "real \<Rightarrow> 'a::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   128
  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
   129
  by (simp add: simple_path_def path_translation_eq)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   130
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   131
lemma simple_path_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   132
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   133
  assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   134
    shows "simple_path(f o g) = simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   135
  using assms inj_on_eq_iff [of f]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   136
  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
   137
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   138
lemma arc_translation_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   139
  fixes g :: "real \<Rightarrow> 'a::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   140
  shows "arc((\<lambda>x. a + x) o g) = arc g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   141
  by (auto simp: arc_def inj_on_def path_translation_eq)
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_linear_image_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   144
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   145
   assumes "linear f" "inj f"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   146
     shows  "arc(f o g) = arc g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   147
  using assms inj_on_eq_iff [of f]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   148
  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
   149
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   150
subsection\<open>Basic lemmas about paths\<close>
60303
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 arc_imp_simple_path: "arc g \<Longrightarrow> simple_path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   153
  by (simp add: arc_def inj_on_def simple_path_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   154
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   155
lemma arc_imp_path: "arc g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   156
  using arc_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   157
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   158
lemma simple_path_imp_path: "simple_path g \<Longrightarrow> path g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   159
  using simple_path_def by blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   160
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   161
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
   162
  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
   163
  by (force)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   164
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   165
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
   166
  using simple_path_cases by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   167
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   168
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
   169
  unfolding arc_def inj_on_def pathfinish_def pathstart_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   170
  by fastforce
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   171
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   172
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
   173
  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
   174
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   175
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
   176
  by (simp add: arc_simple_path)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   177
60974
6a6f15d8fbc4 New material and fixes related to the forthcoming Stone-Weierstrass development
paulson <lp15@cam.ac.uk>
parents: 60809
diff changeset
   178
lemma path_image_nonempty [simp]: "path_image g \<noteq> {}"
56188
0268784f60da use cbox to relax class constraints
immler
parents: 53640
diff changeset
   179
  unfolding path_image_def image_is_empty box_eq_empty
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   180
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   181
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   182
lemma pathstart_in_path_image[intro]: "pathstart g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   183
  unfolding pathstart_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   184
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   185
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   186
lemma pathfinish_in_path_image[intro]: "pathfinish g \<in> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   187
  unfolding pathfinish_def path_image_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   188
  by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   189
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   190
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
   191
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   192
  using connected_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   193
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   194
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
   195
  unfolding path_def path_image_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   196
  using compact_continuous_image connected_Icc by blast
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   197
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   198
lemma reversepath_reversepath[simp]: "reversepath (reversepath g) = g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   199
  unfolding reversepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   200
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   201
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   202
lemma pathstart_reversepath[simp]: "pathstart (reversepath g) = pathfinish g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   203
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   204
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   205
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   206
lemma pathfinish_reversepath[simp]: "pathfinish (reversepath g) = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   207
  unfolding pathstart_def reversepath_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   208
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   209
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   210
lemma pathstart_join[simp]: "pathstart (g1 +++ g2) = pathstart g1"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   211
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   212
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   213
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   214
lemma pathfinish_join[simp]: "pathfinish (g1 +++ g2) = pathfinish g2"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   215
  unfolding pathstart_def joinpaths_def pathfinish_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   216
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   217
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   218
lemma path_image_reversepath[simp]: "path_image (reversepath g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   219
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   220
  have *: "\<And>g. path_image (reversepath g) \<subseteq> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   221
    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
   222
    by force
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   223
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   224
    using *[of g] *[of "reversepath g"]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   225
    unfolding reversepath_reversepath
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   226
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   227
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   228
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   229
lemma path_reversepath [simp]: "path (reversepath g) \<longleftrightarrow> path g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   230
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   231
  have *: "\<And>g. path g \<Longrightarrow> path (reversepath g)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   232
    unfolding path_def reversepath_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   233
    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
   234
    apply (intro continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   235
    apply (rule continuous_on_subset[of "{0..1}"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   236
    apply assumption
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   237
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   238
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   239
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   240
    using *[of "reversepath g"] *[of g]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   241
    unfolding reversepath_reversepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   242
    by (rule iffI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   243
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   244
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   245
lemma arc_reversepath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   246
  assumes "arc g" shows "arc(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   247
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   248
  have injg: "inj_on g {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   249
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   250
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   251
  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
   252
    by simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   253
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   254
    apply (auto simp: arc_def inj_on_def path_reversepath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   255
    apply (simp add: arc_imp_path assms)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   256
    apply (rule **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   257
    apply (rule inj_onD [OF injg])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   258
    apply (auto simp: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   259
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   260
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   261
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   262
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
   263
  apply (simp add: simple_path_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   264
  apply (force simp: reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   265
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   266
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   267
lemmas reversepath_simps =
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   268
  path_reversepath path_image_reversepath pathstart_reversepath pathfinish_reversepath
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   269
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   270
lemma path_join[simp]:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   271
  assumes "pathfinish g1 = pathstart g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   272
  shows "path (g1 +++ g2) \<longleftrightarrow> path g1 \<and> path g2"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   273
  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
   274
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
   275
  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
   276
  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
   277
    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
   278
  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
   279
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   280
    by (intro continuous_on_cong refl) (auto simp: joinpaths_def pathfinish_def pathstart_def)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   281
  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
   282
    unfolding g1 g2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   283
    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
   284
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
   285
  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
   286
  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
   287
    by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   288
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   289
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   290
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   291
    then have "x \<in> (\<lambda>x. x * 2) ` {0..1 / 2}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   292
      by (intro image_eqI[where x="x/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   293
  }
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
   294
  note 1 = this
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   295
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   296
    fix x :: real
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   297
    assume "0 \<le> x" and "x \<le> 1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   298
    then have "x \<in> (\<lambda>x. x * 2 - 1) ` {1 / 2..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   299
      by (intro image_eqI[where x="x/2 + 1/2"]) auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   300
  }
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
   301
  note 2 = this
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   302
  show "continuous_on {0..1} (g1 +++ g2)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   303
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   304
    unfolding joinpaths_def 01
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   305
    apply (intro continuous_on_cases closed_atLeastAtMost g1g2[THEN continuous_on_compose2] continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   306
    apply (auto simp: field_simps pathfinish_def pathstart_def intro!: 1 2)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   307
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   308
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   309
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   310
section \<open>Path Images\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   311
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   312
lemma bounded_path_image: "path g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   313
  by (simp add: compact_imp_bounded compact_path_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   314
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   315
lemma closed_path_image:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   316
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   317
  shows "path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   318
  by (metis compact_path_image compact_imp_closed)
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 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
   321
  by (metis connected_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   322
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   323
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
   324
  by (metis compact_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   325
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   326
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
   327
  by (metis bounded_path_image simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   328
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   329
lemma closed_simple_path_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   330
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   331
  shows "simple_path g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   332
  by (metis closed_path_image simple_path_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 connected_arc_image: "arc g \<Longrightarrow> connected(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   335
  by (metis connected_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   336
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   337
lemma compact_arc_image: "arc g \<Longrightarrow> compact(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   338
  by (metis compact_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   339
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   340
lemma bounded_arc_image: "arc g \<Longrightarrow> bounded(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   341
  by (metis bounded_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   342
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   343
lemma closed_arc_image:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   344
  fixes g :: "real \<Rightarrow> 'a::t2_space"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   345
  shows "arc g \<Longrightarrow> closed(path_image g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   346
  by (metis closed_path_image arc_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   347
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   348
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
   349
  unfolding path_image_def joinpaths_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   350
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   351
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   352
lemma subset_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   353
  assumes "path_image g1 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   354
    and "path_image g2 \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   355
  shows "path_image (g1 +++ g2) \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   356
  using path_image_join_subset[of g1 g2] and assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   357
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   358
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   359
lemma path_image_join:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   360
    "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
   361
  apply (rule subset_antisym [OF path_image_join_subset])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   362
  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
   363
  apply (drule sym)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   364
  apply (rule_tac x="xa/2" in bexI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   365
  apply (rule ccontr)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   366
  apply (drule_tac x="(xa+1)/2" in bspec)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   367
  apply (auto simp: field_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   368
  apply (drule_tac x="1/2" in bspec, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   369
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   370
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   371
lemma not_in_path_image_join:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   372
  assumes "x \<notin> path_image g1"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   373
    and "x \<notin> path_image g2"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   374
  shows "x \<notin> path_image (g1 +++ g2)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   375
  using assms and path_image_join_subset[of g1 g2]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   376
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   377
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   378
lemma pathstart_compose: "pathstart(f o p) = f(pathstart p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   379
  by (simp add: pathstart_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 pathfinish_compose: "pathfinish(f o p) = f(pathfinish p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   382
  by (simp add: pathfinish_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   383
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   384
lemma 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
   385
  by (simp add: image_comp path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   386
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   387
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
   388
  by (rule ext) (simp add: 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 path_compose_reversepath: "f o reversepath p = reversepath(f o p)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   391
  by (rule ext) (simp add: reversepath_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
lemma join_paths_eq:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   394
  "(\<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
   395
   (\<And>t. t \<in> {0..1} \<Longrightarrow> q t = q' t)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   396
   \<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
   397
  by (auto simp: joinpaths_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   398
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   399
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
   400
  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
   401
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   402
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   403
subsection\<open>Simple paths with the endpoints removed\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   404
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   405
lemma simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   406
    "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
   407
  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
   408
  apply (metis eq_iff le_less_linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   409
  apply (metis leD linear)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   410
  using less_eq_real_def zero_le_one apply blast
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   411
  using less_eq_real_def zero_le_one apply blast
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   412
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   413
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   414
lemma connected_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   415
    "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
   416
apply (simp add: simple_path_endless)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   417
apply (rule connected_continuous_image)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   418
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
   419
by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   420
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   421
lemma nonempty_simple_path_endless:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   422
    "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
   423
  by (simp add: simple_path_endless)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   424
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   425
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   426
subsection\<open>The operations on paths\<close>
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   427
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   428
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
   429
  by (auto simp: path_image_def reversepath_def)
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_op_minus: "continuous_on (s::real set) (op - x)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   432
  by (rule continuous_intros | simp)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   433
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   434
lemma path_imp_reversepath: "path g \<Longrightarrow> path(reversepath g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   435
  apply (auto simp: path_def reversepath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   436
  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
   437
  apply (auto simp: continuous_on_op_minus)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   438
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   439
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   440
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
   441
  by simp
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   442
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   443
lemma continuous_on_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   444
  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
   445
    shows "continuous_on {0..1} (g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   446
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   447
  have *: "{0..1::real} = {0..1/2} \<union> {1/2..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   448
    by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   449
  have gg: "g2 0 = g1 1"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   450
    by (metis assms(3) pathfinish_def pathstart_def)
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   451
  have 1: "continuous_on {0..1/2} (g1 +++ g2)"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   452
    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
   453
    apply (rule continuous_intros | simp add: joinpaths_def assms)+
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   454
    done
61204
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   455
  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
   456
    apply (rule continuous_on_subset [of "{1/2..1}"])
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   457
    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
   458
    done
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   459
  then have 2: "continuous_on {1/2..1} (g1 +++ g2)"
3e491e34a62e new lemmas and movement of lemmas into place
paulson
parents: 60974
diff changeset
   460
    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
   461
    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
   462
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   463
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   464
    apply (subst *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   465
    apply (rule continuous_on_union)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   466
    using 1 2
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   467
    apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   468
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   469
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   470
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   471
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
   472
  by (simp add: path_join)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   473
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   474
lemmas join_paths_simps = path_join path_image_join pathstart_join pathfinish_join
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   475
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   476
lemma simple_path_join_loop:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   477
  assumes "arc g1" "arc g2"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   478
          "pathfinish g1 = pathstart g2"  "pathfinish g2 = pathstart g1"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   479
          "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
   480
  shows "simple_path(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   481
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   482
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   483
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   484
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   485
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   486
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   487
    by (simp add: arc_def)
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   488
  have g12: "g1 1 = g2 0"
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   489
   and g21: "g2 1 = g1 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   490
   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
   491
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   492
    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
   493
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   494
    assume xyI: "x = 1 \<longrightarrow> y \<noteq> 0"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   495
       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
   496
    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
   497
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   498
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   499
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   500
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   501
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   502
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   503
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   504
      apply (drule inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   505
      using g21 [symmetric] xyI
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   506
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   507
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   508
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   509
  { fix x and y::real
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   510
    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
   511
    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
   512
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   513
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   514
      apply (rule_tac x="2 * x" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   515
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   516
    have "x = 0 \<and> y = 1"
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   517
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   518
      apply auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   519
      apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   520
      using  g21 [symmetric]
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   521
      apply (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   522
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   523
   } note ** = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   524
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   525
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   526
    apply (simp add: arc_def simple_path_def path_join, clarify)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   527
    apply (simp add: joinpaths_def split: split_if_asm)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   528
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   529
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   530
    apply (metis **)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   531
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   532
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   533
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   534
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   535
lemma arc_join:
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   536
  assumes "arc g1" "arc g2"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   537
          "pathfinish g1 = pathstart g2"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   538
          "path_image g1 \<inter> path_image g2 \<subseteq> {pathstart g2}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   539
    shows "arc(g1 +++ g2)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   540
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   541
  have injg1: "inj_on g1 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   542
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   543
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   544
  have injg2: "inj_on g2 {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   545
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   546
    by (simp add: arc_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   547
  have g11: "g1 1 = g2 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   548
   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
   549
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   550
    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
   551
  { fix x and y::real
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   552
    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
   553
    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
   554
      using xy
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   555
      apply simp
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   556
      apply (rule_tac x="2 * x - 1" in image_eqI, auto)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   557
      done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   558
    have False
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   559
      using subsetD [OF sb g1im] xy
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   560
      by (auto dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   561
   } note * = this
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   562
  show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   563
    apply (simp add: arc_def inj_on_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   564
    apply (clarsimp simp add: arc_imp_path assms path_join)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   565
    apply (simp add: joinpaths_def split: split_if_asm)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   566
    apply (force dest: inj_onD [OF injg1])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   567
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   568
    apply (metis *)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   569
    apply (force dest: inj_onD [OF injg2])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   570
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   571
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   572
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   573
lemma reversepath_joinpaths:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   574
    "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
   575
  unfolding reversepath_def pathfinish_def pathstart_def joinpaths_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   576
  by (rule ext) (auto simp: mult.commute)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   577
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   578
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   579
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
   580
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   581
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
   582
  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
   583
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   584
lemma path_image_subpath_gen [simp]:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   585
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   586
  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
   587
  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
   588
  apply (subst o_def [of g, symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   589
  apply (simp add: image_comp [symmetric])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   590
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   591
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   592
lemma path_image_subpath [simp]:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   593
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   594
  shows "path_image(subpath u v g) = (if u \<le> v then g ` {u..v} else g ` {v..u})"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   595
  by (simp add: closed_segment_eq_real_ivl)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   596
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   597
lemma path_subpath [simp]:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   598
  fixes g :: "real \<Rightarrow> 'a::real_normed_vector"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   599
  assumes "path g" "u \<in> {0..1}" "v \<in> {0..1}"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   600
    shows "path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   601
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   602
  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
   603
    apply (rule continuous_intros | simp)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   604
    apply (simp add: image_affinity_atLeastAtMost [where c=u])
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   605
    using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   606
    apply (auto simp: path_def continuous_on_subset)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   607
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   608
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   609
    by (simp add: path_def subpath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   610
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   611
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   612
lemma pathstart_subpath [simp]: "pathstart(subpath u v g) = g(u)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   613
  by (simp add: pathstart_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   614
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   615
lemma pathfinish_subpath [simp]: "pathfinish(subpath u v g) = g(v)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   616
  by (simp add: pathfinish_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   617
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   618
lemma subpath_trivial [simp]: "subpath 0 1 g = g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   619
  by (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   620
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   621
lemma subpath_reversepath: "subpath 1 0 g = reversepath g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   622
  by (simp add: reversepath_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   623
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   624
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
   625
  by (simp add: reversepath_def subpath_def algebra_simps)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   626
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   627
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
   628
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   629
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   630
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
   631
  by (rule ext) (simp add: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   632
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   633
lemma affine_ineq:
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   634
  fixes x :: "'a::linordered_idom"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   635
  assumes "x \<le> 1" "v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   636
    shows "v + x * u \<le> u + x * v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   637
proof -
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   638
  have "(1-x)*(u-v) \<ge> 0"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   639
    using assms by auto
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   640
  then show ?thesis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   641
    by (simp add: algebra_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   642
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   643
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   644
lemma simple_path_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   645
  "simple_path(subpath u v g) \<longleftrightarrow>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   646
     path(subpath u v g) \<and> u\<noteq>v \<and>
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   647
     (\<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
   648
                \<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
   649
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   650
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   651
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   652
  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
   653
        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
   654
                  \<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
   655
    by (auto simp: simple_path_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   656
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   657
    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
   658
    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
   659
    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
   660
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost divide_simps
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   661
       split: split_if_asm)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   662
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   663
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   664
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   665
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   666
  ultimately show ?rhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   667
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   668
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   669
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   670
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   671
  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
   672
   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
   673
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   674
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   675
    by (auto simp: closed_segment_real_eq image_affinity_atLeastAtMost)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   676
  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
   677
    by algebra
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   678
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   679
    unfolding simple_path_def subpath_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   680
    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
   681
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   682
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   683
lemma arc_subpath_eq:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   684
  "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
   685
    (is "?lhs = ?rhs")
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   686
proof (rule iffI)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   687
  assume ?lhs
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   688
  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
   689
        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
   690
                  \<Longrightarrow> x = y)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   691
    by (auto simp: arc_def inj_on_def subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   692
  { fix x y
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   693
    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
   694
    then have "x = y"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   695
    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
   696
    by (force simp add: inj_on_def closed_segment_real_eq image_affinity_atLeastAtMost divide_simps
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   697
       split: split_if_asm)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   698
  } moreover
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   699
  have "path(subpath u v g) \<and> u\<noteq>v"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   700
    using sim [of "1/3" "2/3"] p
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   701
    by (auto simp: subpath_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   702
  ultimately show ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   703
    unfolding inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   704
    by metis
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   705
next
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   706
  assume ?rhs
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   707
  then
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   708
  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
   709
   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
   710
   and ne: "u < v \<or> v < u"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   711
   and psp: "path (subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   712
    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
   713
  show ?lhs using psp ne
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   714
    unfolding arc_def subpath_def inj_on_def
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   715
    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
   716
qed
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   717
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   718
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   719
lemma simple_path_subpath:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   720
  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
   721
  shows "simple_path(subpath u v g)"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   722
  using assms
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   723
  apply (simp add: simple_path_subpath_eq simple_path_imp_path)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   724
  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
   725
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   726
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   727
lemma arc_simple_path_subpath:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   728
    "\<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
   729
  by (force intro: simple_path_subpath simple_path_imp_arc)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   730
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   731
lemma arc_subpath_arc:
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   732
    "\<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
   733
  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
   734
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   735
lemma arc_simple_path_subpath_interior:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   736
    "\<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
   737
    apply (rule arc_simple_path_subpath)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   738
    apply (force simp: simple_path_def)+
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   739
    done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   740
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   741
lemma path_image_subpath_subset:
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   742
    "\<lbrakk>path g; u \<in> {0..1}; v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image(subpath u v g) \<subseteq> path_image g"
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   743
  apply (simp add: closed_segment_real_eq image_affinity_atLeastAtMost)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   744
  apply (auto simp: path_image_def)
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   745
  done
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   746
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   747
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
   748
  by (rule ext) (simp add: joinpaths_def subpath_def divide_simps)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   749
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   750
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
   751
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   752
lemma subpath_to_frontier_explicit:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   753
    fixes S :: "'a::metric_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   754
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   755
    obtains u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   756
                "\<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
   757
                "(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
   758
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   759
  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
   760
  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
   761
    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
   762
    using compact_eq_bounded_closed apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   763
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   764
  have "1 \<in> {u. g u \<in> closure (- S)}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   765
    using assms by (simp add: pathfinish_def closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   766
  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
   767
    using atLeastAtMost_iff zero_le_one by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   768
  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
   769
                  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
   770
    using compact_attains_inf [OF com dis] by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   771
  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
   772
    using closure_def by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   773
  { assume "u \<noteq> 0"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   774
    then have "u > 0" using `0 \<le> u` by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   775
    { fix e::real assume "e > 0"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   776
      obtain d where "d>0" and d: "\<And>x'. \<lbrakk>x' \<in> {0..1}; dist x' u < d\<rbrakk> \<Longrightarrow> dist (g x') (g u) < e"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   777
        using continuous_onD [OF gcon _ `e > 0`] `0 \<le> _` `_ \<le> 1` atLeastAtMost_iff by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   778
      have *: "dist (max 0 (u - d / 2)) u < d"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   779
        using `0 \<le> u` `u \<le> 1` `d > 0` by (simp add: dist_real_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   780
      have "\<exists>y\<in>S. dist y (g u) < e"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   781
        using `0 < u` `u \<le> 1` `d > 0`
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   782
        by (force intro: d [OF _ *] umin')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   783
    }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   784
    then have "g u \<in> closure S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   785
      by (simp add: frontier_def closure_approachable)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   786
  }
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   787
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   788
    apply (rule_tac u=u in that)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   789
    apply (auto simp: `0 \<le> u` `u \<le> 1` gu interior_closure umin)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   790
    using `_ \<le> 1` interior_closure umin apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   791
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   792
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   793
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   794
lemma subpath_to_frontier_strong:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   795
    assumes g: "path g" and "pathfinish g \<notin> S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   796
    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
   797
                    "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
   798
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   799
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   800
             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
   801
             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
   802
    using subpath_to_frontier_explicit [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   803
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   804
    apply (rule that [OF `0 \<le> u` `u \<le> 1`])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   805
    apply (simp add: gunot)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   806
    using `0 \<le> u` u0 by (force simp: subpath_def gxin)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   807
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   808
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   809
lemma subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   810
    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
   811
    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
   812
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   813
  obtain u where "0 \<le> u" "u \<le> 1"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   814
             and notin: "g u \<notin> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   815
             and disj: "u = 0 \<or>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   816
                        (\<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
   817
    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
   818
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   819
    apply (rule that [OF `0 \<le> u` `u \<le> 1`])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   820
    apply (metis DiffI disj frontier_def g0 notin pathstart_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   821
    using `0 \<le> u` g0 disj
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   822
    apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   823
    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
   824
    apply (rename_tac y)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   825
    apply (drule_tac x="y/u" in spec)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   826
    apply (auto split: split_if_asm)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   827
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   828
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   829
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   830
lemma exists_path_subpath_to_frontier:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   831
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   832
    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
   833
    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
   834
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   835
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   836
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   837
  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
   838
    using subpath_to_frontier [OF assms] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   839
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   840
    apply (rule that [of "subpath 0 u g"])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   841
    using assms u
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   842
    apply simp_all
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   843
    apply (simp add: pathstart_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   844
    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
   845
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   846
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   847
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   848
lemma exists_path_subpath_to_frontier_closed:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   849
    fixes S :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   850
    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
   851
    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
   852
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   853
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   854
  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
   855
                    "path_image h - {pathfinish h} \<subseteq> interior S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   856
                    "pathfinish h \<in> frontier S"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   857
    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
   858
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   859
    apply (rule that [OF `path h`])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   860
    using assms h
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   861
    apply auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   862
    apply (metis diff_single_insert frontier_subset_eq insert_iff interior_subset subset_iff)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   863
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
   864
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   865
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   866
subsection \<open>Reparametrizing a closed curve to start at some chosen point\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   867
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   868
definition shiftpath :: "real \<Rightarrow> (real \<Rightarrow> 'a::topological_space) \<Rightarrow> real \<Rightarrow> 'a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   869
  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
   870
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   871
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
   872
  unfolding pathstart_def shiftpath_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   873
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   874
lemma pathfinish_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   875
  assumes "0 \<le> a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   876
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   877
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   878
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   879
  unfolding pathstart_def pathfinish_def shiftpath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   880
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   881
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   882
lemma endpoints_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   883
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   884
    and "a \<in> {0 .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   885
  shows "pathfinish (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   886
    and "pathstart (shiftpath a g) = g a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   887
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   888
  by (auto intro!: pathfinish_shiftpath pathstart_shiftpath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   889
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   890
lemma closed_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   891
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   892
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   893
  shows "pathfinish (shiftpath a g) = pathstart (shiftpath a g)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   894
  using endpoints_shiftpath[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   895
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   896
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   897
lemma path_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   898
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   899
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   900
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   901
  shows "path (shiftpath a g)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   902
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   903
  have *: "{0 .. 1} = {0 .. 1-a} \<union> {1-a .. 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   904
    using assms(3) by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   905
  have **: "\<And>x. x + a = 1 \<Longrightarrow> g (x + a - 1) = g (x + a)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   906
    using assms(2)[unfolded pathfinish_def pathstart_def]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   907
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   908
  show ?thesis
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   909
    unfolding path_def shiftpath_def *
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   910
    apply (rule continuous_on_union)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   911
    apply (rule closed_real_atLeastAtMost)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   912
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   913
    prefer 3
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   914
    apply (rule continuous_on_eq[of _ "g \<circ> (\<lambda>x. a - 1 + x)"])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   915
    prefer 3
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   916
    apply (rule continuous_intros)+
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   917
    prefer 2
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
   918
    apply (rule continuous_intros)+
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   919
    apply (rule_tac[1-2] continuous_on_subset[OF assms(1)[unfolded path_def]])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   920
    using assms(3) and **
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   921
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   922
    apply (auto simp add: field_simps)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   923
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   924
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   925
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   926
lemma shiftpath_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   927
  assumes "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   928
    and "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   929
    and "x \<in> {0..1}"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   930
  shows "shiftpath (1 - a) (shiftpath a g) x = g x"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   931
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   932
  unfolding pathfinish_def pathstart_def shiftpath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   933
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   934
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   935
lemma path_image_shiftpath:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   936
  assumes "a \<in> {0..1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   937
    and "pathfinish g = pathstart g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   938
  shows "path_image (shiftpath a g) = path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   939
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   940
  { fix x
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   941
    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
   942
    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
   943
    proof (cases "a \<le> x")
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   944
      case False
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
   945
      then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   946
        apply (rule_tac x="1 + x - a" in bexI)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   947
        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
   948
        apply (auto simp add: field_simps atomize_not)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   949
        done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   950
    next
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   951
      case True
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   952
      then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   953
        using as(1-2) and assms(1)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   954
        apply (rule_tac x="x - a" in bexI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   955
        apply (auto simp add: field_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   956
        done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   957
    qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   958
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
   959
  then show ?thesis
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   960
    using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   961
    unfolding shiftpath_def path_image_def pathfinish_def pathstart_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   962
    by (auto simp add: image_iff)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   963
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   964
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   965
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
   966
subsection \<open>Special case of straight-line paths\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   967
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   968
definition linepath :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> real \<Rightarrow> 'a"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   969
  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
   970
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   971
lemma pathstart_linepath[simp]: "pathstart (linepath a b) = a"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   972
  unfolding pathstart_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   973
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   974
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   975
lemma pathfinish_linepath[simp]: "pathfinish (linepath a b) = b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   976
  unfolding pathfinish_def linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   977
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   978
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   979
lemma continuous_linepath_at[intro]: "continuous (at x) (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   980
  unfolding linepath_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   981
  by (intro continuous_intros)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   982
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   983
lemma continuous_on_linepath[intro]: "continuous_on s (linepath a b)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   984
  using continuous_linepath_at
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   985
  by (auto intro!: continuous_at_imp_continuous_on)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   986
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   987
lemma path_linepath[intro]: "path (linepath a b)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   988
  unfolding path_def
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   989
  by (rule continuous_on_linepath)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   990
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   991
lemma path_image_linepath[simp]: "path_image (linepath a b) = closed_segment a b"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   992
  unfolding path_image_def segment linepath_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   993
  by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   994
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
   995
lemma reversepath_linepath[simp]: "reversepath (linepath a b) = linepath b a"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
   996
  unfolding reversepath_def linepath_def
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   997
  by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
   998
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
   999
lemma arc_linepath:
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1000
  assumes "a \<noteq> b"
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1001
  shows "arc (linepath a b)"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1002
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1003
  {
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1004
    fix x y :: "real"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1005
    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
  1006
    then have "(x - y) *\<^sub>R a = (x - y) *\<^sub>R b"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1007
      by (simp add: algebra_simps)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1008
    with assms have "x = y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1009
      by simp
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1010
  }
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1011
  then show ?thesis
60809
457abb82fb9e the Cauchy integral theorem and related material
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
  1012
    unfolding arc_def inj_on_def
60303
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1013
    by (simp add:  path_linepath) (force simp: algebra_simps linepath_def)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1014
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1015
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1016
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
  1017
  by (simp add: arc_imp_simple_path arc_linepath)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1018
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1019
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1020
subsection \<open>Bounding a point away from a path\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1021
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1022
lemma not_on_path_ball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1023
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1024
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1025
    and "z \<notin> path_image g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1026
  shows "\<exists>e > 0. ball z e \<inter> path_image g = {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1027
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1028
  obtain a where "a \<in> path_image g" "\<forall>y \<in> path_image g. dist z a \<le> dist z y"
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1029
    using distance_attains_inf[OF _ path_image_nonempty, of g z]
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1030
    using compact_path_image[THEN compact_imp_closed, OF assms(1)] by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1031
  then show ?thesis
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1032
    apply (rule_tac x="dist z a" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1033
    using assms(2)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1034
    apply (auto intro!: dist_pos_lt)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1035
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1036
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1037
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1038
lemma not_on_path_cball:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1039
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1040
  assumes "path g"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1041
    and "z \<notin> path_image g"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1042
  shows "\<exists>e>0. cball z e \<inter> (path_image g) = {}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1043
proof -
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1044
  obtain e where "ball z e \<inter> path_image g = {}" "e > 0"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1045
    using not_on_path_ball[OF assms] by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1046
  moreover have "cball z (e/2) \<subseteq> ball z e"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1047
    using \<open>e > 0\<close> by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1048
  ultimately show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1049
    apply (rule_tac x="e/2" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1050
    apply auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1051
    done
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1052
qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1053
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1054
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1055
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
  1056
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1057
definition "path_component s x y \<longleftrightarrow>
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1058
  (\<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
  1059
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1060
abbreviation
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1061
   "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
  1062
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1063
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
  1064
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1065
lemma path_component_mem:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1066
  assumes "path_component s x y"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1067
  shows "x \<in> s" and "y \<in> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1068
  using assms
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1069
  unfolding path_defs
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1070
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1071
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1072
lemma path_component_refl:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1073
  assumes "x \<in> s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1074
  shows "path_component s x x"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1075
  unfolding path_defs
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1076
  apply (rule_tac x="\<lambda>u. x" in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1077
  using assms
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1078
  apply (auto intro!: continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1079
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1080
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1081
lemma path_component_refl_eq: "path_component s x x \<longleftrightarrow> x \<in> s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1082
  by (auto intro!: path_component_mem path_component_refl)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1083
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1084
lemma path_component_sym: "path_component s x y \<Longrightarrow> path_component s y x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1085
  using assms
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1086
  unfolding path_component_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1087
  apply (erule exE)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1088
  apply (rule_tac x="reversepath g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1089
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1090
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1091
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1092
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
  1093
  assumes "path_component s x y" and "path_component s y z"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1094
  shows "path_component s x z"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1095
  using assms
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1096
  unfolding path_component_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1097
  apply (elim exE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1098
  apply (rule_tac x="g +++ ga" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1099
  apply (auto simp add: path_image_join)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1100
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1101
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1102
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
  1103
  unfolding path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1104
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1105
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
  1106
    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
  1107
    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
  1108
  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
  1109
  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
  1110
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1111
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1112
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1113
text \<open>Can also consider it as a set, as the name suggests.\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1114
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1115
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
  1116
  "path_component_set s x =
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1117
    {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
  1118
  by (auto simp: path_component_def)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1119
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1120
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
  1121
  by (auto simp add: path_component_mem(2))
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1122
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1123
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
  1124
  using path_component_mem path_component_refl_eq
00c06f1315d0 New material about paths, and some lemmas
paulson
parents: 59557
diff changeset
  1125
    by fastforce
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1126
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1127
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
  1128
     "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
  1129
  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
  1130
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1131
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
  1132
   "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
  1133
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
  1134
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1135
subsection \<open>Path connectedness of a space\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1136
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1137
definition "path_connected s \<longleftrightarrow>
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1138
  (\<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
  1139
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1140
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
  1141
  unfolding path_connected_def path_component_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1142
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1143
lemma path_connected_component_set: "path_connected s \<longleftrightarrow> (\<forall>x\<in>s. path_component_set s x = s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1144
  unfolding path_connected_component 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
  1145
  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
  1146
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1147
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
  1148
     "\<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
  1149
  by (metis path_component_mono path_connected_component_set)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1150
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1151
subsection \<open>Some useful lemmas about path-connectedness\<close>
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1152
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1153
lemma convex_imp_path_connected:
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1154
  fixes s :: "'a::real_normed_vector set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1155
  assumes "convex s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1156
  shows "path_connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1157
  unfolding path_connected_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1158
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1159
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1160
  apply (rule_tac x = "linepath x y" in exI)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1161
  unfolding path_image_linepath
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1162
  using assms [unfolded convex_contains_segment]
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1163
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1164
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1165
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1166
lemma path_connected_imp_connected:
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1167
  assumes "path_connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1168
  shows "connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1169
  unfolding connected_def not_ex
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1170
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1171
  apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1172
  apply (rule ccontr)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1173
  unfolding not_not
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1174
  apply (elim conjE)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1175
proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1176
  fix e1 e2
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1177
  assume as: "open e1" "open e2" "s \<subseteq> e1 \<union> e2" "e1 \<inter> e2 \<inter> s = {}" "e1 \<inter> s \<noteq> {}" "e2 \<inter> s \<noteq> {}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1178
  then obtain x1 x2 where obt:"x1 \<in> e1 \<inter> s" "x2 \<in> e2 \<inter> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1179
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1180
  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
  1181
    using assms[unfolded path_connected_def,rule_format,of x1 x2] by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1182
  have *: "connected {0..1::real}"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1183
    by (auto intro!: convex_connected convex_real_interval)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1184
  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
  1185
    using as(3) g(2)[unfolded path_defs] by blast
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1186
  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
  1187
    using as(4) g(2)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1188
    unfolding subset_eq
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1189
    by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1190
  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
  1191
    using g(3,4)[unfolded path_defs]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1192
    using obt
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1193
    by (simp add: ex_in_conv [symmetric], metis zero_le_one order_refl)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1194
  ultimately show False
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1195
    using *[unfolded connected_local not_ex, rule_format,
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1196
      of "{x\<in>{0..1}. g x \<in> e1}" "{x\<in>{0..1}. g x \<in> e2}"]
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1197
    using continuous_openin_preimage[OF g(1)[unfolded path_def] as(1)]
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1198
    using continuous_openin_preimage[OF g(1)[unfolded path_def] as(2)]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1199
    by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1200
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1201
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1202
lemma open_path_component:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1203
  fixes s :: "'a::real_normed_vector set"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1204
  assumes "open s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1205
  shows "open (path_component_set s x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1206
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1207
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1208
  fix y
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1209
  assume as: "y \<in> path_component_set s x"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1210
  then have "y \<in> s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1211
    apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1212
    apply (rule path_component_mem(2))
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1213
    unfolding mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1214
    apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1215
    done
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1216
  then obtain e where e: "e > 0" "ball y e \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1217
    using assms[unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1218
    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
  1219
  show "\<exists>e > 0. ball y e \<subseteq> path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1220
    apply (rule_tac x=e in exI)
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1221
    apply (rule,rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1222
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1223
    unfolding mem_ball mem_Collect_eq
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1224
  proof -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1225
    fix z
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1226
    assume "dist y z < e"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1227
    then show "path_component s x z"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1228
      apply (rule_tac path_component_trans[of _ _ y])
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1229
      defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1230
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1231
      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
  1232
      using \<open>e > 0\<close> as
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1233
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1234
      done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1235
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1236
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1237
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1238
lemma open_non_path_component:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1239
  fixes s :: "'a::real_normed_vector set"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1240
  assumes "open s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1241
  shows "open (s - path_component_set s x)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1242
  unfolding open_contains_ball
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1243
proof
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1244
  fix y
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1245
  assume as: "y \<in> s - path_component_set s x"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1246
  then obtain e where e: "e > 0" "ball y e \<subseteq> s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1247
    using assms [unfolded open_contains_ball]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1248
    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
  1249
  show "\<exists>e>0. ball y e \<subseteq> s - path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1250
    apply (rule_tac x=e in exI)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1251
    apply rule
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1252
    apply (rule \<open>e>0\<close>)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1253
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1254
    apply rule
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1255
    defer
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1256
  proof (rule ccontr)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1257
    fix z
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1258
    assume "z \<in> ball y e" "\<not> z \<notin> path_component_set s x"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1259
    then have "y \<in> path_component_set s x"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1260
      unfolding not_not mem_Collect_eq using \<open>e>0\<close>
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1261
      apply -
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1262
      apply (rule path_component_trans, assumption)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1263
      apply (rule path_component_of_subset[OF e(2)])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1264
      apply (rule convex_imp_path_connected[OF convex_ball, unfolded path_connected_component, rule_format])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1265
      apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1266
      done
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1267
    then show False
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1268
      using as by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1269
  qed (insert e(2), auto)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1270
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1271
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1272
lemma connected_open_path_connected:
53593
a7bcbb5a17d8 removed outdated comments
huffman
parents: 51481
diff changeset
  1273
  fixes s :: "'a::real_normed_vector set"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1274
  assumes "open s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1275
    and "connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1276
  shows "path_connected s"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1277
  unfolding path_connected_component_set
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1278
proof (rule, rule, rule path_component_subset, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1279
  fix x y
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1280
  assume "x \<in> s" and "y \<in> s"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1281
  show "y \<in> path_component_set s x"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1282
  proof (rule ccontr)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1283
    assume "\<not> ?thesis"
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1284
    moreover have "path_component_set s x \<inter> s \<noteq> {}"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1285
      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
  1286
      by auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1287
    ultimately
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1288
    show False
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1289
      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
  1290
      using assms(2)[unfolded connected_def not_ex, rule_format,
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1291
        of "path_component_set s x" "s - path_component_set s x"]
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1292
      by auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1293
  qed
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1294
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1295
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1296
lemma path_connected_continuous_image:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1297
  assumes "continuous_on s f"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1298
    and "path_connected s"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1299
  shows "path_connected (f ` s)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1300
  unfolding path_connected_def
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1301
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1302
  fix x' y'
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1303
  assume "x' \<in> f ` s" "y' \<in> f ` s"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1304
  then obtain x y where x: "x \<in> s" and y: "y \<in> s" and x': "x' = f x" and y': "y' = f y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1305
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1306
  from x y obtain g where "path g \<and> path_image g \<subseteq> s \<and> pathstart g = x \<and> pathfinish g = y"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1307
    using assms(2)[unfolded path_connected_def] by fast
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1308
  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
  1309
    unfolding x' y'
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1310
    apply (rule_tac x="f \<circ> g" in exI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1311
    unfolding path_defs
51481
ef949192e5d6 move continuous_on_inv to HOL image (simplifies isCont_inverse_function)
hoelzl
parents: 51478
diff changeset
  1312
    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
  1313
    apply auto
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1314
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1315
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1316
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1317
lemma path_connected_segment:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1318
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1319
    shows "path_connected (closed_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1320
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1321
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1322
lemma path_connected_open_segment:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1323
    fixes a :: "'a::real_normed_vector"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1324
    shows "path_connected (open_segment a b)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1325
  by (simp add: convex_imp_path_connected)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1326
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1327
lemma homeomorphic_path_connectedness:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1328
  "s homeomorphic t \<Longrightarrow> path_connected s \<longleftrightarrow> path_connected t"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1329
  unfolding homeomorphic_def homeomorphism_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1330
  apply (erule exE|erule conjE)+
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1331
  apply rule
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1332
  apply (drule_tac f=f in path_connected_continuous_image)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1333
  prefer 3
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1334
  apply (drule_tac f=g in path_connected_continuous_image)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1335
  apply auto
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1336
  done
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1337
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1338
lemma path_connected_empty: "path_connected {}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1339
  unfolding path_connected_def by auto
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1340
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1341
lemma path_connected_singleton: "path_connected {a}"
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1342
  unfolding path_connected_def pathstart_def pathfinish_def path_image_def
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1343
  apply clarify
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1344
  apply (rule_tac x="\<lambda>x. a" in exI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1345
  apply (simp add: image_constant_conv)
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1346
  apply (simp add: path_def continuous_on_const)
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1347
  done
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1348
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1349
lemma path_connected_Un:
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1350
  assumes "path_connected s"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1351
    and "path_connected t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1352
    and "s \<inter> t \<noteq> {}"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1353
  shows "path_connected (s \<union> t)"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1354
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1355
proof (rule, rule)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1356
  fix x y
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1357
  assume as: "x \<in> s \<union> t" "y \<in> s \<union> t"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1358
  from assms(3) obtain z where "z \<in> s \<inter> t"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1359
    by auto
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1360
  then show "path_component (s \<union> t) x y"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1361
    using as and assms(1-2)[unfolded path_connected_component]
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1362
    apply -
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1363
    apply (erule_tac[!] UnE)+
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1364
    apply (rule_tac[2-3] path_component_trans[of _ _ z])
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1365
    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
  1366
    done
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1367
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1368
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1369
lemma path_connected_UNION:
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1370
  assumes "\<And>i. i \<in> A \<Longrightarrow> path_connected (S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1371
    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
  1372
  shows "path_connected (\<Union>i\<in>A. S i)"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1373
  unfolding path_connected_component
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1374
proof clarify
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1375
  fix x i y j
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1376
  assume *: "i \<in> A" "x \<in> S i" "j \<in> A" "y \<in> S j"
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1377
  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
  1378
    using assms by (simp_all add: path_connected_component)
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1379
  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
  1380
    using *(1,3) by (auto elim!: path_component_of_subset [rotated])
49654
366d8b41ca17 tuned proofs;
wenzelm
parents: 49653
diff changeset
  1381
  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
  1382
    by (rule path_component_trans)
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1383
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1384
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1385
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
  1386
  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
  1387
  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
  1388
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
  1389
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
  1390
  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
  1391
  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
  1392
  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
  1393
  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
  1394
    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
  1395
      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
  1396
  next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1397
    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
  1398
      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
  1399
      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
  1400
      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
  1401
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1402
    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
  1403
      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
  1404
    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
  1405
      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
  1406
      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
  1407
      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
  1408
      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
  1409
      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
  1410
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1411
  qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1412
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1413
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1414
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
  1415
  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
  1416
  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
  1417
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1418
lemma path_connected_path_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1419
   "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
  1420
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1421
  { 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
  1422
    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
  1423
    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
  1424
      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
  1425
    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
  1426
      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
  1427
    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
  1428
      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
  1429
      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
  1430
      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
  1431
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1432
  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
  1433
    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
  1434
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1435
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1436
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
  1437
  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
  1438
  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
  1439
  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
  1440
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1441
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
  1442
   "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
  1443
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
  1444
  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
  1445
    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
  1446
    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
  1447
    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
  1448
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1449
  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
  1450
    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
  1451
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1452
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1453
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
  1454
   "(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
  1455
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
  1456
  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
  1457
    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
  1458
    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
  1459
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1460
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1461
  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
  1462
    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
  1463
qed
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1464
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 60303
diff changeset
  1465
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
  1466
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1467
lemma path_connected_punctured_universe:
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1468
  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
  1469
  shows "path_connected (- {a::'a})"
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1470
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
  1471
  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
  1472
  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
  1473
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1474
  have A: "path_connected ?A"
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1475
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1476
  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
  1477
    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
  1478
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1479
    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
  1480
      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
  1481
    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
  1482
      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
  1483
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1484
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1485
  have B: "path_connected ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1486
    unfolding Collect_bex_eq
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1487
  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
  1488
    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
  1489
    assume "i \<in> Basis"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1490
    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
  1491
      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
  1492
    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
  1493
      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
  1494
      by (simp add: inner_commute)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1495
  qed
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1496
  obtain S :: "'a set" where "S \<subseteq> Basis" and "card S = Suc (Suc 0)"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1497
    using ex_card[OF assms]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1498
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1499
  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
  1500
    unfolding card_Suc_eq by auto
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1501
  then have "a + b0 - b1 \<in> ?A \<inter> ?B"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1502
    by (auto simp: inner_simps inner_Basis)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1503
  then have "?A \<inter> ?B \<noteq> {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1504
    by fast
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1505
  with A B have "path_connected (?A \<union> ?B)"
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1506
    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
  1507
  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
  1508
    unfolding neq_iff bex_disj_distrib Collect_disj_eq ..
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1509
  also have "\<dots> = {x. x \<noteq> a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1510
    unfolding euclidean_eq_iff [where 'a='a]
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1511
    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
  1512
  also have "\<dots> = - {a}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1513
    by auto
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1514
  finally show ?thesis .
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1515
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1516
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1517
lemma path_connected_sphere:
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1518
  assumes "2 \<le> DIM('a::euclidean_space)"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1519
  shows "path_connected {x::'a. norm (x - a) = r}"
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1520
proof (rule linorder_cases [of r 0])
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1521
  assume "r < 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1522
  then have "{x::'a. norm(x - a) = r} = {}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1523
    by auto
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1524
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1525
    using path_connected_empty by simp
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1526
next
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1527
  assume "r = 0"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1528
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1529
    using path_connected_singleton by simp
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1530
next
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1531
  assume r: "0 < r"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1532
  have *: "{x::'a. norm(x - a) = r} = (\<lambda>x. a + r *\<^sub>R x) ` {x. norm x = 1}"
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1533
    apply (rule set_eqI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1534
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1535
    unfolding image_iff
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1536
    apply (rule_tac x="(1/r) *\<^sub>R (x - a)" in bexI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1537
    unfolding mem_Collect_eq norm_scaleR
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1538
    using r
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1539
    apply (auto simp add: scaleR_right_diff_distrib)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1540
    done
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1541
  have **: "{x::'a. norm x = 1} = (\<lambda>x. (1/norm x) *\<^sub>R x) ` (- {0})"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1542
    apply (rule set_eqI)
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1543
    apply rule
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1544
    unfolding image_iff
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1545
    apply (rule_tac x=x in bexI)
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1546
    unfolding mem_Collect_eq
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1547
    apply (auto split: split_if_asm)
49653
03bc7afe8814 tuned proofs;
wenzelm
parents: 48125
diff changeset
  1548
    done
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1549
  have "continuous_on (- {0}) (\<lambda>x::'a. 1 / norm x)"
59557
ebd8ecacfba6 establish unique preferred fact names
haftmann
parents: 58877
diff changeset
  1550
    by (auto intro!: continuous_intros)
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1551
  then show ?thesis
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1552
    unfolding * **
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1553
    using path_connected_punctured_universe[OF assms]
56371
fb9ae0727548 extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents: 56188
diff changeset
  1554
    by (auto intro!: path_connected_continuous_image continuous_intros)
37674
f86de9c00c47 convert theorem path_connected_sphere to euclidean_space class
huffman
parents: 37489
diff changeset
  1555
qed
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1556
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1557
corollary connected_sphere: "2 \<le> DIM('a::euclidean_space) \<Longrightarrow> connected {x::'a. norm (x - a) = r}"
53640
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1558
  using path_connected_sphere path_connected_imp_connected
3170b5eb9f5a tuned proofs;
wenzelm
parents: 53593
diff changeset
  1559
  by auto
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  1560
61426
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1561
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
  1562
    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
  1563
    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
  1564
    shows "path_connected (- s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1565
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
  1566
  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
  1567
    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
  1568
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1569
  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
  1570
  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
  1571
  { fix x y assume "x \<notin> s" "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
  1572
    then have "x \<noteq> a" "y \<noteq> a" using `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
  1573
    then have bxy: "bounded(insert x (insert y s))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1574
      by (simp add: `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
  1575
    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
  1576
                          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
  1577
      using bounded_subset_ballD [OF bxy, of a] 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
  1578
    def C == "B / norm(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
  1579
    { 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
  1580
      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
  1581
      have CC: "1 \<le> 1 + (C - 1) * u"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1582
        using `x \<noteq> a` `0 \<le> u`
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1583
        apply (simp add: C_def divide_simps 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
  1584
        by (metis Bx diff_le_iff(1) less_eq_real_def mult_nonneg_nonneg)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1585
      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
  1586
        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
  1587
      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
  1588
            (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
  1589
        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
  1590
      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
  1591
        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
  1592
      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
  1593
        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
  1594
      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
  1595
              ((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
  1596
        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
  1597
      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
  1598
        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
  1599
      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
  1600
        using `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
  1601
        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
  1602
        apply (drule_tac 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
  1603
         apply (rule  `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
  1604
        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
  1605
         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
  1606
        apply (drule_tac x="1 / (1 + (C - 1) * u)" in spec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1607
        using `x \<noteq> a` `x \<notin> s` `0 \<le> u` CC
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1608
        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
  1609
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1610
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1611
    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
  1612
      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
  1613
    def D == "B / norm(y - a)"  --{*massive duplication with the proof above*}
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1614
    { 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
  1615
      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
  1616
      have DD: "1 \<le> 1 + (D - 1) * u"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1617
        using `y \<noteq> a` `0 \<le> u`
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1618
        apply (simp add: D_def divide_simps 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
  1619
        by (metis By diff_le_iff(1) less_eq_real_def mult_nonneg_nonneg)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1620
      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
  1621
        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
  1622
      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
  1623
            (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
  1624
        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
  1625
      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
  1626
        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
  1627
      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
  1628
        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
  1629
      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
  1630
              ((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
  1631
        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
  1632
      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
  1633
        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
  1634
      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
  1635
        using `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
  1636
        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
  1637
        apply (drule_tac 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
  1638
         apply (rule  `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
  1639
        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
  1640
         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
  1641
        apply (drule_tac x="1 / (1 + (D - 1) * u)" in spec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1642
        using `y \<noteq> a` `y \<notin> s` `0 \<le> u` DD
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1643
        apply (auto simp: xeq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1644
        done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1645
    }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1646
    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
  1647
      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
  1648
    have pyx: "path_component (- s) (a + D *\<^sub>R (y - a)) (a + C *\<^sub>R (x - a))"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1649
      apply (rule path_component_of_subset [of "{x. norm(x - 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
  1650
       using `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
  1651
       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
  1652
      apply (rule path_connected_sphere [OF 2, of a B, simplified path_connected_component, 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
  1653
      using `x \<noteq> a`  using `y \<noteq> a`  B apply (auto simp: C_def D_def)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1654
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1655
    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
  1656
      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
  1657
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1658
  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
  1659
    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
  1660
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1661
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1662
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1663
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
  1664
    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
  1665
    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
  1666
      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
  1667
  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
  1668
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1669
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
  1670
    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
  1671
    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
  1672
      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
  1673
  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
  1674
  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
  1675
  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
  1676
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1677
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1678
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
  1679
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1680
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
  1681
  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
  1682
  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
  1683
    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
  1684
    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
  1685
    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
  1686
     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
  1687
    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
  1688
    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
  1689
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1690
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
  1691
    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
  1692
    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
  1693
  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
  1694
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1695
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
  1696
  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
  1697
  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
  1698
  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
  1699
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1700
  { 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
  1701
    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
  1702
      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
  1703
    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
  1704
      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
  1705
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1706
  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
  1707
    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
  1708
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1709
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1710
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
  1711
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1712
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
  1713
    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
  1714
    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
  1715
      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
  1716
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1717
  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
  1718
    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
  1719
  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
  1720
    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
  1721
  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
  1722
    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
  1723
  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
  1724
    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
  1725
    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
  1726
    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
  1727
    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
  1728
    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
  1729
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1730
  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
  1731
    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
  1732
    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
  1733
    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
  1734
    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
  1735
    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
  1736
  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
  1737
    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
  1738
  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
  1739
    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
  1740
    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
  1741
    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
  1742
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1743
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1744
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1745
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
  1746
    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
  1747
    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
  1748
        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
  1749
                "~ 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
  1750
      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
  1751
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1752
  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
  1753
    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
  1754
  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
  1755
    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
  1756
  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
  1757
    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
  1758
  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
  1759
    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
  1760
  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
  1761
    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
  1762
    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
  1763
  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
  1764
    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
  1765
    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
  1766
  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
  1767
    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
  1768
    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
  1769
    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
  1770
    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
  1771
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1772
  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
  1773
    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
  1774
    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
  1775
    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
  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
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1778
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
  1779
    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
  1780
    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
  1781
  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
  1782
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1783
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
  1784
    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
  1785
    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
  1786
  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
  1787
  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
  1788
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1789
lemma cobounded_has_bounded_component:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1790
    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
  1791
    shows "\<lbrakk>bounded (- s); ~connected s; 2 \<le> DIM('a)\<rbrakk> \<Longrightarrow> \<exists>c. c \<in> components s \<and> bounded c"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1792
  by (meson cobounded_unique_unbounded_components connected_eq_connected_components_eq)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1793
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1794
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  1795
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
  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
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
  1798
  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
  1799
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1800
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
  1801
  "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
  1802
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1803
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
  1804
  "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
  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 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
  1807
  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
  1808
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1809
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
  1810
  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
  1811
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1812
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
  1813
   "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
  1814
  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
  1815
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1816
lemma inside_inter_outside [simp]: "inside s \<inter> 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
  1817
  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
  1818
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1819
lemma inside_union_outside [simp]: "inside s \<union> outside s = (- s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1820
  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
  1821
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1822
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
  1823
   "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
  1824
  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
  1825
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1826
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
  1827
  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
  1828
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1829
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
  1830
  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
  1831
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1832
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
  1833
  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
  1834
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1835
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
  1836
  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
  1837
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1838
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
  1839
  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
  1840
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1841
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
  1842
  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
  1843
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1844
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
  1845
  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
  1846
  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
  1847
  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
  1848
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1849
  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
  1850
    using assms by auto (metis add.commute diff_add_cancel)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1851
  with `0 \<le> u` `u \<le> 1` 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
  1852
    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
  1853
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1854
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1855
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
  1856
  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
  1857
  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
  1858
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1859
  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
  1860
    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
  1861
  { 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
  1862
    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
  1863
    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
  1864
    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
  1865
      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
  1866
    next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1867
      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
  1868
        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
  1869
        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
  1870
        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
  1871
        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
  1872
        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
  1873
         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
  1874
        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
  1875
        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
  1876
        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
  1877
        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
  1878
    qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1879
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1880
  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
  1881
    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
  1882
    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
  1883
    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
  1884
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1885
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1886
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1887
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
  1888
    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
  1889
    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
  1890
  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
  1891
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1892
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
  1893
    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
  1894
    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
  1895
  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
  1896
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1897
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
  1898
    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
  1899
    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
  1900
      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
  1901
  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
  1902
  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
  1903
  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
  1904
  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
  1905
  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
  1906
  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
  1907
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1908
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1909
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
  1910
    "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
  1911
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
  1912
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
  1913
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
  1914
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1915
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
  1916
   "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
  1917
            {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
  1918
                         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
  1919
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
  1920
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
  1921
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
  1922
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1923
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
  1924
    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
  1925
    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
  1926
      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
  1927
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1928
  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
  1929
    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
  1930
  { 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
  1931
    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
  1932
    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
  1933
      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
  1934
      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
  1935
      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
  1936
      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
  1937
    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
  1938
      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
  1939
      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
  1940
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1941
  } 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
  1942
  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
  1943
    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
  1944
    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
  1945
    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
  1946
    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
  1947
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1948
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1949
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
  1950
    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
  1951
    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
  1952
      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
  1953
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
  1954
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
  1955
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1956
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
  1957
    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
  1958
    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
  1959
      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
  1960
  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
  1961
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1962
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
  1963
    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
  1964
    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
  1965
      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
  1966
  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
  1967
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1968
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
  1969
  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
  1970
  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
  1971
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
  1972
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
  1973
       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
  1974
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1975
lemma frontier_interiors: "frontier s = - interior(s) - interior(-s)"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1976
  by (simp add: Int_commute frontier_def interior_closure)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1977
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1978
lemma connected_inter_frontier:
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1979
     "\<lbrakk>connected s; s \<inter> t \<noteq> {}; s - t \<noteq> {}\<rbrakk> \<Longrightarrow> (s \<inter> frontier t \<noteq> {})"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1980
  apply (simp add: frontier_interiors connected_open_in, safe)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1981
  apply (drule_tac x="s \<inter> interior t" in spec, safe)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1982
   apply (drule_tac [2] x="s \<inter> interior (-t)" in spec)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1983
   apply (auto simp: disjoint_eq_subset_Compl dest: interior_subset [THEN subsetD])
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1984
  done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1985
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1986
lemma 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
  1987
    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
  1988
    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
  1989
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
  1990
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
  1991
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1992
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
  1993
    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
  1994
    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
  1995
  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
  1996
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1997
lemma components_univ [simp]: "components UNIV = {UNIV :: 'a::real_normed_vector set}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  1998
  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
  1999
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2000
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
  2001
    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
  2002
    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
  2003
      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
  2004
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2005
  { 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
  2006
    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
  2007
       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
  2008
    have "connected_component_set (- frontier s) x \<inter> frontier s \<noteq> {}"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2009
      apply (rule connected_inter_frontier, simp)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2010
      apply (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
  2011
      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
  2012
      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
  2013
    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
  2014
      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
  2015
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2016
  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
  2017
    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
  2018
    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
  2019
    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
  2020
    done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2021
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2022
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2023
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
  2024
  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
  2025
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2026
lemma outside_empty [simp]: "outside {} = (UNIV :: '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
  2027
using inside_empty inside_union_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
  2028
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2029
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
  2030
   "\<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
  2031
  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
  2032
  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
  2033
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2034
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
  2035
   "\<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
  2036
  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
  2037
  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
  2038
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2039
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
  2040
  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
  2041
  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
  2042
    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
  2043
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
  2044
  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
  2045
next
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2046
  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
  2047
  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
  2048
  { 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
  2049
    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
  2050
      by (metis 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
  2051
    def C \<equiv> "((B + 1 + norm z) / norm (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
  2052
    have "C > 0"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2053
      using `0 < B` zna by (simp add: C_def divide_simps add_strict_increasing)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2054
    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
  2055
      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
  2056
    moreover have "norm (C *\<^sub>R (z-a)) > norm z + B"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2057
      using zna `B>0` by (simp add: C_def le_max_iff_disj 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
  2058
    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
  2059
    { 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
  2060
      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
  2061
      then have Cpos: "1 + u * C > 0"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2062
        by (meson `0 < C` add_pos_nonneg less_eq_real_def zero_le_mult_iff zero_less_one)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2063
      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
  2064
        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
  2065
      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
  2066
        using convexD_alt [OF s `a \<in> s` ins, of "1/(u*C + 1)"] `C>0` `z \<notin> s` Cpos 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
        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
  2068
    } 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
  2069
    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
  2070
      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
  2071
      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
  2072
      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
  2073
      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
  2074
      done
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2075
    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
  2076
      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
  2077
      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
  2078
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2079
  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
  2080
    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
  2081
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2082
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2083
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
  2084
  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
  2085
  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
  2086
    shows "outside s = - s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2087
  by (metis ComplD assms convex_in_outside equalityI inside_union_outside subsetI sup.cobounded2)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2088
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2089
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
  2090
  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
  2091
  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
  2092
  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
  2093
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2094
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
  2095
  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
  2096
  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
  2097
  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
  2098
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2099
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
  2100
    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
  2101
    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
  2102
    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
  2103
  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
  2104
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2105
  { 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
  2106
    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
  2107
      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
  2108
    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
  2109
      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
  2110
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2111
  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
  2112
    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
  2113
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2114
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2115
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
  2116
  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
  2117
    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
  2118
      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
  2119
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
  2120
          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
  2121
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2122
lemma inside_frontier_eq_interior:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2123
     fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2124
     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
  2125
  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
  2126
  using closure_subset interior_subset
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2127
  apply (auto simp add: frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2128
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2129
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
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
  2131
    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
  2132
    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
  2133
      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
  2134
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2135
  { 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
  2136
    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
  2137
      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
  2138
    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
  2139
      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
  2140
      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
  2141
      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
  2142
    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
  2143
      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
  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 (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
  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
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
  2150
    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
  2151
    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
  2152
      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
  2153
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2154
  { 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
  2155
    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
  2156
      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
  2157
    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
  2158
      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
  2159
      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
  2160
      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
  2161
    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
  2162
      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
  2163
  }
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2164
  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
  2165
    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
  2166
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2167
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2168
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
  2169
    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
  2170
    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
  2171
      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
  2172
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
  2173
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2174
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
  2175
    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
  2176
    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
  2177
      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
  2178
proof -
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2179
  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
  2180
    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
  2181
  moreover have "- inside s \<inter> - outside s = s"
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2182
    by (metis (no_types) compl_sup double_compl inside_union_outside)
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2183
  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
  2184
    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
  2185
  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
  2186
    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
  2187
  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
  2188
    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
  2189
qed
d53db136e8fd new material on path_component_sets, inside, outside, etc. And more default simprules
paulson <lp15@cam.ac.uk>
parents: 61204
diff changeset
  2190
61518
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2191
lemma closure_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2192
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2193
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2194
      shows "closure(outside s) \<subseteq> s \<union> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2195
  apply (rule closure_minimal, simp)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2196
  by (metis assms closed_open inside_outside open_inside)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2197
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2198
lemma frontier_outside_subset:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2199
    fixes s :: "'a::real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2200
    assumes "closed s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2201
      shows "frontier(outside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2202
  apply (simp add: frontier_def open_outside interior_open)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2203
  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
  2204
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2205
lemma inside_complement_unbounded_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2206
     "\<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
  2207
  apply (simp add: inside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2208
  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
  2209
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2210
lemma inside_bounded_complement_connected_empty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2211
    fixes s :: "'a::{real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2212
    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
  2213
  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
  2214
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2215
lemma inside_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2216
    assumes "s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2217
    shows "inside s - t \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2218
unfolding inside_def
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2219
proof clarify
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2220
  fix x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2221
  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
  2222
  show "bounded (connected_component_set (- t) x)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2223
  proof (cases "s \<inter> connected_component_set (- t) x = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2224
    case True show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2225
      apply (rule bounded_subset [OF bo])
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2226
      apply (rule connected_component_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2227
      using x True apply auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2228
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2229
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2230
    case False then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2231
      using assms [unfolded inside_def] x
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2232
      apply (simp add: disjoint_iff_not_equal, clarify)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2233
      apply (drule subsetD, assumption, auto)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2234
      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
  2235
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2236
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2237
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2238
lemma inside_inside_subset: "inside(inside s) \<subseteq> s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2239
  using inside_inside union_with_outside by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2240
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2241
lemma inside_outside_intersect_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2242
      "\<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
  2243
  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
  2244
  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
  2245
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2246
lemma outside_bounded_nonempty:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2247
  fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2248
    assumes "bounded s" shows "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2249
  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
  2250
                   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
  2251
                   double_complement order_refl outside_convex outside_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2252
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2253
lemma outside_compact_in_open:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2254
    fixes s :: "'a :: {real_normed_vector,perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2255
    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
  2256
      shows "outside s \<inter> t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2257
proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2258
  have "outside s \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2259
    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
  2260
  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
  2261
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2262
  proof (cases "a \<in> t")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2263
    case True with a show ?thesis by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2264
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2265
    case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2266
      have front: "frontier t \<subseteq> - s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2267
        using `s \<subseteq> t` frontier_disjoint_eq t by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2268
      { fix \<gamma>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2269
        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
  2270
           and pf: "pathfinish \<gamma> \<in> frontier t" and ps: "pathstart \<gamma> = a"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2271
        def c \<equiv> "pathfinish \<gamma>"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2272
        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
  2273
        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
  2274
        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
  2275
          using open_contains_cball[of "-s"] s by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2276
        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
  2277
          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
  2278
          by (metis Diff_iff frontier_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2279
        then have "d \<in> -s" using \<epsilon>
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2280
          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
  2281
        have pimg_sbs_cos: "path_image \<gamma> \<subseteq> -s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2282
          using pimg_sbs apply (auto simp: path_image_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2283
          apply (drule subsetD)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2284
          using `c \<in> - s` `s \<subseteq> t` interior_subset apply (auto simp: c_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2285
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2286
        have "closed_segment c d \<le> cball c \<epsilon>"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2287
          apply (simp add: segment_convex_hull)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2288
          apply (rule hull_minimal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2289
          using  `\<epsilon> > 0` d apply (auto simp: dist_commute)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2290
          done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2291
        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
  2292
        moreover have con_gcd: "connected (path_image \<gamma> \<union> closed_segment c d)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2293
          by (rule connected_Un) (auto simp: c_def `path \<gamma>` connected_path_image)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2294
        ultimately have "connected_component (- s) a d"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2295
          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
  2296
        then have "outside s \<inter> t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2297
          using outside_same_component [OF _ a]  by (metis IntI `d \<in> t` empty_iff)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2298
      } note * = this
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2299
      have pal: "pathstart (linepath a b) \<in> closure (- t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2300
        by (auto simp: False closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2301
      show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2302
        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
  2303
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2304
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2305
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2306
lemma inside_inside_compact_connected:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2307
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2308
    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
  2309
      shows "inside s \<subseteq> inside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2310
proof (cases "inside t = {}")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2311
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2312
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2313
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2314
  consider "DIM('a) = 1" | "DIM('a) \<ge> 2"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2315
    using antisym not_less_eq_eq by fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2316
  then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2317
  proof cases
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2318
    case 1 then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2319
             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
  2320
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2321
    case 2
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2322
    have coms: "compact s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2323
      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
  2324
       by (meson bounded_inside bounded_subset compact_imp_bounded)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2325
    then have bst: "bounded (s \<union> t)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2326
      by (simp add: compact_imp_bounded t)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2327
    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
  2328
      using bounded_subset_ballD by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2329
    have outst: "outside s \<inter> outside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2330
    proof -
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2331
      have "- ball 0 r \<subseteq> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2332
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2333
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2334
      moreover have "- ball 0 r \<subseteq> outside t"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2335
        apply (rule outside_subset_convex)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2336
        using r by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2337
      ultimately show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2338
        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
  2339
    qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2340
    have "s \<inter> t = {}" using assms
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2341
      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
  2342
    moreover have "outside s \<inter> inside t \<noteq> {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2343
      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
  2344
    ultimately have "inside s \<inter> t = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2345
      using inside_outside_intersect_connected [OF `connected t`, of s]
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2346
      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
  2347
    then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2348
      using inside_inside [OF `s \<subseteq> inside t`] by blast
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2349
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2350
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2351
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2352
lemma connected_with_inside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2353
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2354
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2355
      shows "connected(s \<union> inside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2356
proof (cases "s \<union> inside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2357
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2358
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2359
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2360
  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
  2361
  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
  2362
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2363
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2364
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2365
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2366
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2367
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2368
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2369
    assume a: "a \<in> inside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2370
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2371
      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
  2372
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2373
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2374
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2375
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2376
      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
  2377
      using frontier_inside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2378
      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
  2379
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2380
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2381
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2382
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2383
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2384
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2385
    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
  2386
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2387
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2388
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2389
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2390
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
  2391
lemma connected_with_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2392
    fixes s :: "'a :: real_normed_vector set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2393
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2394
      shows "connected(s \<union> outside s)"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2395
proof (cases "s \<union> outside s = UNIV")
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2396
  case True with assms show ?thesis by auto
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2397
next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2398
  case False
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2399
  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
  2400
  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
  2401
  using that proof
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2402
    assume "a \<in> s" then show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2403
      apply (rule_tac x=a in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2404
      apply (rule_tac x="{a}" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2405
      apply (simp add:)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2406
      done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2407
  next
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2408
    assume a: "a \<in> outside s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2409
    show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2410
      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
  2411
      using a apply (simp add: closure_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2412
      apply (simp add: b)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2413
      apply (rule_tac x="pathfinish h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2414
      apply (rule_tac x="path_image h" in exI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2415
      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
  2416
      using frontier_outside_subset s apply fastforce
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2417
      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
  2418
  qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2419
  show ?thesis
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2420
    apply (simp add: connected_iff_connected_component)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2421
    apply (simp add: connected_component_def)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2422
    apply (clarify dest!: *)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2423
    apply (rename_tac u u' t t')
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2424
    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
  2425
    apply (auto simp: intro!: connected_Un cons)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2426
    done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2427
qed
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2428
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2429
lemma inside_inside_eq_empty [simp]:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2430
    fixes s :: "'a :: {real_normed_vector, perfect_space} set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2431
    assumes s: "closed s" and cons: "connected s"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2432
      shows "inside (inside s) = {}"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2433
  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
  2434
           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
  2435
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2436
lemma inside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2437
     "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
  2438
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2439
  apply (auto intro: inside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2440
  apply (metis IntI empty_iff inside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2441
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2442
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2443
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
  2444
lemma outside_in_components:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2445
     "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
  2446
  apply (simp add: in_components_maximal)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2447
  apply (auto intro: outside_same_component connected_componentI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2448
  apply (metis IntI empty_iff outside_no_overlap)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2449
  done
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2450
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2451
lemma bounded_unique_outside:
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2452
    fixes s :: "'a :: euclidean_space set"
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2453
    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
  2454
  apply (rule iffI)
ff12606337e9 new lemmas about topology, etc., for Cauchy integral formula
paulson
parents: 61426
diff changeset
  2455
  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
  2456
  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
  2457
36583
68ce5760c585 move path-related stuff into new theory file
huffman
parents:
diff changeset
  2458
end