src/HOL/Analysis/Starlike.thy
author paulson <lp15@cam.ac.uk>
Sat, 02 Nov 2019 20:51:54 +0000
changeset 71004 b86d30707837
parent 70817 dd675800469d
child 71008 e892f7a1fd83
permissions -rw-r--r--
just tidied one proof
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     1
(* Title:      HOL/Analysis/Starlike.thy
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     2
   Author:     L C Paulson, University of Cambridge
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     3
   Author:     Robert Himmelmann, TU Muenchen
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     4
   Author:     Bogdan Grechuk, University of Edinburgh
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     5
   Author:     Armin Heller, TU Muenchen
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     6
   Author:     Johannes Hoelzl, TU Muenchen
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     7
*)
69676
56acd449da41 chapters for analysis manual
immler
parents: 69675
diff changeset
     8
chapter \<open>Unsorted\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     9
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    10
theory Starlike
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
    11
imports Convex_Euclidean_Space Abstract_Limits
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    12
begin
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    13
69676
56acd449da41 chapters for analysis manual
immler
parents: 69675
diff changeset
    14
section \<open>Line Segments\<close>
56acd449da41 chapters for analysis manual
immler
parents: 69675
diff changeset
    15
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    16
subsection \<open>Midpoint\<close>
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    17
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
    18
definition\<^marker>\<open>tag important\<close> midpoint :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    19
  where "midpoint a b = (inverse (2::real)) *\<^sub>R (a + b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    20
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    21
lemma midpoint_idem [simp]: "midpoint x x = x"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
    22
  unfolding midpoint_def  by simp
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    23
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    24
lemma midpoint_sym: "midpoint a b = midpoint b a"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    25
  unfolding midpoint_def by (auto simp add: scaleR_right_distrib)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    26
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    27
lemma midpoint_eq_iff: "midpoint a b = c \<longleftrightarrow> a + b = c + c"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    28
proof -
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    29
  have "midpoint a b = c \<longleftrightarrow> scaleR 2 (midpoint a b) = scaleR 2 c"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    30
    by simp
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    31
  then show ?thesis
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    32
    unfolding midpoint_def scaleR_2 [symmetric] by simp
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    33
qed
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    34
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    35
lemma
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    36
  fixes a::real
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    37
  assumes "a \<le> b" shows ge_midpoint_1: "a \<le> midpoint a b"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    38
                    and le_midpoint_1: "midpoint a b \<le> b"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    39
  by (simp_all add: midpoint_def assms)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    40
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    41
lemma dist_midpoint:
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    42
  fixes a b :: "'a::real_normed_vector" shows
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    43
  "dist a (midpoint a b) = (dist a b) / 2" (is ?t1)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    44
  "dist b (midpoint a b) = (dist a b) / 2" (is ?t2)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    45
  "dist (midpoint a b) a = (dist a b) / 2" (is ?t3)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    46
  "dist (midpoint a b) b = (dist a b) / 2" (is ?t4)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    47
proof -
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    48
  have *: "\<And>x y::'a. 2 *\<^sub>R x = - y \<Longrightarrow> norm x = (norm y) / 2"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    49
    unfolding equation_minus_iff by auto
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    50
  have **: "\<And>x y::'a. 2 *\<^sub>R x =   y \<Longrightarrow> norm x = (norm y) / 2"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    51
    by auto
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    52
  note scaleR_right_distrib [simp]
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    53
  show ?t1
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    54
    unfolding midpoint_def dist_norm
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    55
    apply (rule **)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    56
    apply (simp add: scaleR_right_diff_distrib)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    57
    apply (simp add: scaleR_2)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    58
    done
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    59
  show ?t2
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    60
    unfolding midpoint_def dist_norm
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    61
    apply (rule *)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    62
    apply (simp add: scaleR_right_diff_distrib)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    63
    apply (simp add: scaleR_2)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    64
    done
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    65
  show ?t3
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    66
    unfolding midpoint_def dist_norm
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    67
    apply (rule *)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    68
    apply (simp add: scaleR_right_diff_distrib)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    69
    apply (simp add: scaleR_2)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    70
    done
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    71
  show ?t4
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    72
    unfolding midpoint_def dist_norm
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    73
    apply (rule **)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    74
    apply (simp add: scaleR_right_diff_distrib)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    75
    apply (simp add: scaleR_2)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    76
    done
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    77
qed
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    78
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    79
lemma midpoint_eq_endpoint [simp]:
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    80
  "midpoint a b = a \<longleftrightarrow> a = b"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    81
  "midpoint a b = b \<longleftrightarrow> a = b"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    82
  unfolding midpoint_eq_iff by auto
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    83
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    84
lemma midpoint_plus_self [simp]: "midpoint a b + midpoint a b = a + b"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    85
  using midpoint_eq_iff by metis
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    86
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    87
lemma midpoint_linear_image:
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    88
   "linear f \<Longrightarrow> midpoint(f a)(f b) = f(midpoint a b)"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    89
by (simp add: linear_iff midpoint_def)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    90
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    91
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    92
subsection \<open>Line segments\<close>
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
    93
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
    94
definition\<^marker>\<open>tag important\<close> closed_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    95
  where "closed_segment a b = {(1 - u) *\<^sub>R a + u *\<^sub>R b | u::real. 0 \<le> u \<and> u \<le> 1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    96
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
    97
definition\<^marker>\<open>tag important\<close> open_segment :: "'a::real_vector \<Rightarrow> 'a \<Rightarrow> 'a set" where
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    98
  "open_segment a b \<equiv> closed_segment a b - {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    99
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   100
lemmas segment = open_segment_def closed_segment_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   101
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   102
lemma in_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   103
    "x \<in> closed_segment a b \<longleftrightarrow> (\<exists>u. 0 \<le> u \<and> u \<le> 1 \<and> x = (1 - u) *\<^sub>R a + u *\<^sub>R b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   104
    "x \<in> open_segment a b \<longleftrightarrow> a \<noteq> b \<and> (\<exists>u. 0 < u \<and> u < 1 \<and> x = (1 - u) *\<^sub>R a + u *\<^sub>R b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   105
  using less_eq_real_def by (auto simp: segment algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   106
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   107
lemma closed_segment_linear_image:
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   108
  "closed_segment (f a) (f b) = f ` (closed_segment a b)" if "linear f"
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   109
proof -
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   110
  interpret linear f by fact
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   111
  show ?thesis
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   112
    by (force simp add: in_segment add scale)
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
   113
qed
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   114
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   115
lemma open_segment_linear_image:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   116
    "\<lbrakk>linear f; inj f\<rbrakk> \<Longrightarrow> open_segment (f a) (f b) = f ` (open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   117
  by (force simp: open_segment_def closed_segment_linear_image inj_on_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   118
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   119
lemma closed_segment_translation:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   120
    "closed_segment (c + a) (c + b) = image (\<lambda>x. c + x) (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   121
apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   122
apply (rule_tac x="x-c" in image_eqI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   123
apply (auto simp: in_segment algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   124
done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   125
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   126
lemma open_segment_translation:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   127
    "open_segment (c + a) (c + b) = image (\<lambda>x. c + x) (open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   128
by (simp add: open_segment_def closed_segment_translation translation_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   129
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   130
lemma closed_segment_of_real:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   131
    "closed_segment (of_real x) (of_real y) = of_real ` closed_segment x y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   132
  apply (auto simp: image_iff in_segment scaleR_conv_of_real)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   133
    apply (rule_tac x="(1-u)*x + u*y" in bexI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   134
  apply (auto simp: in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   135
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   136
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   137
lemma open_segment_of_real:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   138
    "open_segment (of_real x) (of_real y) = of_real ` open_segment x y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   139
  apply (auto simp: image_iff in_segment scaleR_conv_of_real)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   140
    apply (rule_tac x="(1-u)*x + u*y" in bexI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   141
  apply (auto simp: in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   142
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   143
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   144
lemma closed_segment_Reals:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   145
    "\<lbrakk>x \<in> Reals; y \<in> Reals\<rbrakk> \<Longrightarrow> closed_segment x y = of_real ` closed_segment (Re x) (Re y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   146
  by (metis closed_segment_of_real of_real_Re)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   147
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   148
lemma open_segment_Reals:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   149
    "\<lbrakk>x \<in> Reals; y \<in> Reals\<rbrakk> \<Longrightarrow> open_segment x y = of_real ` open_segment (Re x) (Re y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   150
  by (metis open_segment_of_real of_real_Re)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   151
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   152
lemma open_segment_PairD:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   153
    "(x, x') \<in> open_segment (a, a') (b, b')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   154
     \<Longrightarrow> (x \<in> open_segment a b \<or> a = b) \<and> (x' \<in> open_segment a' b' \<or> a' = b')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   155
  by (auto simp: in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   156
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   157
lemma closed_segment_PairD:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   158
  "(x, x') \<in> closed_segment (a, a') (b, b') \<Longrightarrow> x \<in> closed_segment a b \<and> x' \<in> closed_segment a' b'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   159
  by (auto simp: closed_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   160
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   161
lemma closed_segment_translation_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   162
    "d + x \<in> closed_segment (d + a) (d + b) \<longleftrightarrow> x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   163
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   164
  have *: "\<And>d x a b. x \<in> closed_segment a b \<Longrightarrow> d + x \<in> closed_segment (d + a) (d + b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   165
    apply (simp add: closed_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   166
    apply (erule ex_forward)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   167
    apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   168
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   169
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   170
  using * [where d = "-d"] *
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   171
  by (fastforce simp add:)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   172
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   173
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   174
lemma open_segment_translation_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   175
    "d + x \<in> open_segment (d + a) (d + b) \<longleftrightarrow> x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   176
  by (simp add: open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   177
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   178
lemma of_real_closed_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   179
  "of_real x \<in> closed_segment (of_real a) (of_real b) \<longleftrightarrow> x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   180
  apply (auto simp: in_segment scaleR_conv_of_real elim!: ex_forward)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   181
  using of_real_eq_iff by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   182
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   183
lemma of_real_open_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   184
  "of_real x \<in> open_segment (of_real a) (of_real b) \<longleftrightarrow> x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   185
  apply (auto simp: in_segment scaleR_conv_of_real elim!: ex_forward del: exE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   186
  using of_real_eq_iff by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   187
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   188
lemma convex_contains_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   189
  "convex S \<longleftrightarrow> (\<forall>a\<in>S. \<forall>b\<in>S. closed_segment a b \<subseteq> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   190
  unfolding convex_alt closed_segment_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   191
68465
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   192
lemma closed_segment_in_Reals:
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   193
   "\<lbrakk>x \<in> closed_segment a b; a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> x \<in> Reals"
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   194
  by (meson subsetD convex_Reals convex_contains_segment)
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   195
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   196
lemma open_segment_in_Reals:
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   197
   "\<lbrakk>x \<in> open_segment a b; a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> x \<in> Reals"
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   198
  by (metis Diff_iff closed_segment_in_Reals open_segment_def)
e699ca8e22b7 New material in support of quaternions
paulson <lp15@cam.ac.uk>
parents: 68077
diff changeset
   199
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   200
lemma closed_segment_subset: "\<lbrakk>x \<in> S; y \<in> S; convex S\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   201
  by (simp add: convex_contains_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   202
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   203
lemma closed_segment_subset_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   204
    "\<lbrakk>x \<in> convex hull S; y \<in> convex hull S\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> convex hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   205
  using convex_contains_segment by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   206
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   207
lemma segment_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   208
  "closed_segment a b = convex hull {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   209
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   210
  have *: "\<And>x. {x} \<noteq> {}" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   211
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   212
    unfolding segment convex_hull_insert[OF *] convex_hull_singleton
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   213
    by (safe; rule_tac x="1 - u" in exI; force)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   214
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   215
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   216
lemma open_closed_segment: "u \<in> open_segment w z \<Longrightarrow> u \<in> closed_segment w z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   217
  by (auto simp add: closed_segment_def open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   218
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   219
lemma segment_open_subset_closed:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   220
   "open_segment a b \<subseteq> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   221
  by (auto simp: closed_segment_def open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   222
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   223
lemma bounded_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   224
    fixes a :: "'a::euclidean_space" shows "bounded (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   225
  by (simp add: segment_convex_hull compact_convex_hull compact_imp_bounded)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   226
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   227
lemma bounded_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   228
    fixes a :: "'a::euclidean_space" shows "bounded (open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   229
  by (rule bounded_subset [OF bounded_closed_segment segment_open_subset_closed])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   230
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   231
lemmas bounded_segment = bounded_closed_segment open_closed_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   232
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   233
lemma ends_in_segment [iff]: "a \<in> closed_segment a b" "b \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   234
  unfolding segment_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   235
  by (auto intro!: hull_subset[unfolded subset_eq, rule_format])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   236
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   237
lemma eventually_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   238
  fixes x0::"'a::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   239
  assumes "open X0" "x0 \<in> X0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   240
  shows "\<forall>\<^sub>F x in at x0 within U. closed_segment x0 x \<subseteq> X0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   241
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   242
  from openE[OF assms]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   243
  obtain e where e: "0 < e" "ball x0 e \<subseteq> X0" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   244
  then have "\<forall>\<^sub>F x in at x0 within U. x \<in> ball x0 e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   245
    by (auto simp: dist_commute eventually_at)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   246
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   247
  proof eventually_elim
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   248
    case (elim x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   249
    have "x0 \<in> ball x0 e" using \<open>e > 0\<close> by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   250
    from convex_ball[unfolded convex_contains_segment, rule_format, OF this elim]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   251
    have "closed_segment x0 x \<subseteq> ball x0 e" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   252
    also note \<open>\<dots> \<subseteq> X0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   253
    finally show ?case .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   254
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   255
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   256
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   257
lemma segment_furthest_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   258
  fixes a b x y :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   259
  assumes "x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   260
  shows "norm (y - x) \<le> norm (y - a) \<or>  norm (y - x) \<le> norm (y - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   261
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   262
  obtain z where "z \<in> {a, b}" "norm (x - y) \<le> norm (z - y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   263
    using simplex_furthest_le[of "{a, b}" y]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   264
    using assms[unfolded segment_convex_hull]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   265
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   266
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   267
    by (auto simp add:norm_minus_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   268
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   269
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   270
lemma closed_segment_commute: "closed_segment a b = closed_segment b a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   271
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   272
  have "{a, b} = {b, a}" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   273
  thus ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   274
    by (simp add: segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   275
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   276
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   277
lemma segment_bound1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   278
  assumes "x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   279
  shows "norm (x - a) \<le> norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   280
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   281
  obtain u where "x = (1 - u) *\<^sub>R a + u *\<^sub>R b" "0 \<le> u" "u \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   282
    using assms by (auto simp add: closed_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   283
  then show "norm (x - a) \<le> norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   284
    apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   285
    apply (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   286
    apply (simp add: scaleR_diff_right [symmetric] mult_left_le_one_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   287
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   288
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   290
lemma segment_bound:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   291
  assumes "x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   292
  shows "norm (x - a) \<le> norm (b - a)" "norm (x - b) \<le> norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   293
apply (simp add: assms segment_bound1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   294
by (metis assms closed_segment_commute dist_commute dist_norm segment_bound1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   295
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   296
lemma open_segment_commute: "open_segment a b = open_segment b a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   297
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   298
  have "{a, b} = {b, a}" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   299
  thus ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   300
    by (simp add: closed_segment_commute open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   301
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   302
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   303
lemma closed_segment_idem [simp]: "closed_segment a a = {a}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   304
  unfolding segment by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   305
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   306
lemma open_segment_idem [simp]: "open_segment a a = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   307
  by (simp add: open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   308
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   309
lemma closed_segment_eq_open: "closed_segment a b = open_segment a b \<union> {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   310
  using open_segment_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   311
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   312
lemma convex_contains_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   313
  "convex s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. open_segment a b \<subseteq> s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   314
  by (simp add: convex_contains_segment closed_segment_eq_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   315
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   316
lemma closed_segment_eq_real_ivl:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   317
  fixes a b::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   318
  shows "closed_segment a b = (if a \<le> b then {a .. b} else {b .. a})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   319
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   320
  have "b \<le> a \<Longrightarrow> closed_segment b a = {b .. a}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   321
    and "a \<le> b \<Longrightarrow> closed_segment a b = {a .. b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   322
    by (auto simp: convex_hull_eq_real_cbox segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   323
  thus ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   324
    by (auto simp: closed_segment_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   325
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   326
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   327
lemma open_segment_eq_real_ivl:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   328
  fixes a b::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   329
  shows "open_segment a b = (if a \<le> b then {a<..<b} else {b<..<a})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   330
by (auto simp: closed_segment_eq_real_ivl open_segment_def split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   331
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   332
lemma closed_segment_real_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   333
  fixes u::real shows "closed_segment u v = (\<lambda>x. (v - u) * x + u) ` {0..1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   334
  by (simp add: add.commute [of u] image_affinity_atLeastAtMost [where c=u] closed_segment_eq_real_ivl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   335
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   336
lemma dist_in_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   337
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   338
  assumes "x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   339
    shows "dist x a \<le> dist a b \<and> dist x b \<le> dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   340
proof (intro conjI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   341
  obtain u where u: "0 \<le> u" "u \<le> 1" and x: "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   342
    using assms by (force simp: in_segment algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   343
  have "dist x a = u * dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   344
    apply (simp add: dist_norm algebra_simps x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   345
    by (metis \<open>0 \<le> u\<close> abs_of_nonneg norm_minus_commute norm_scaleR real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   346
  also have "...  \<le> dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   347
    by (simp add: mult_left_le_one_le u)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   348
  finally show "dist x a \<le> dist a b" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   349
  have "dist x b = norm ((1-u) *\<^sub>R a - (1-u) *\<^sub>R b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   350
    by (simp add: dist_norm algebra_simps x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   351
  also have "... = (1-u) * dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   352
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   353
    have "norm ((1 - 1 * u) *\<^sub>R (a - b)) = (1 - 1 * u) * norm (a - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   354
      using \<open>u \<le> 1\<close> by force
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   355
    then show ?thesis
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   356
      by (simp add: dist_norm real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   357
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   358
  also have "... \<le> dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   359
    by (simp add: mult_left_le_one_le u)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   360
  finally show "dist x b \<le> dist a b" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   361
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   362
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   363
lemma dist_in_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   364
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   365
  assumes "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   366
    shows "dist x a < dist a b \<and> dist x b < dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   367
proof (intro conjI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   368
  obtain u where u: "0 < u" "u < 1" and x: "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   369
    using assms by (force simp: in_segment algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   370
  have "dist x a = u * dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   371
    apply (simp add: dist_norm algebra_simps x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   372
    by (metis abs_of_nonneg less_eq_real_def norm_minus_commute norm_scaleR real_vector.scale_right_diff_distrib \<open>0 < u\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   373
  also have *: "...  < dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   374
    by (metis (no_types) assms dist_eq_0_iff dist_not_less_zero in_segment(2) linorder_neqE_linordered_idom mult.left_neutral real_mult_less_iff1 \<open>u < 1\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   375
  finally show "dist x a < dist a b" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   376
  have ab_ne0: "dist a b \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   377
    using * by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   378
  have "dist x b = norm ((1-u) *\<^sub>R a - (1-u) *\<^sub>R b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   379
    by (simp add: dist_norm algebra_simps x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   380
  also have "... = (1-u) * dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   381
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   382
    have "norm ((1 - 1 * u) *\<^sub>R (a - b)) = (1 - 1 * u) * norm (a - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   383
      using \<open>u < 1\<close> by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   384
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   385
      by (simp add: dist_norm real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   386
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   387
  also have "... < dist a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   388
    using ab_ne0 \<open>0 < u\<close> by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   389
  finally show "dist x b < dist a b" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   390
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   391
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   392
lemma dist_decreases_open_segment_0:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   393
  fixes x :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   394
  assumes "x \<in> open_segment 0 b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   395
    shows "dist c x < dist c 0 \<or> dist c x < dist c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   396
proof (rule ccontr, clarsimp simp: not_less)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   397
  obtain u where u: "0 \<noteq> b" "0 < u" "u < 1" and x: "x = u *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   398
    using assms by (auto simp: in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   399
  have xb: "x \<bullet> b < b \<bullet> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   400
    using u x by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   401
  assume "norm c \<le> dist c x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   402
  then have "c \<bullet> c \<le> (c - x) \<bullet> (c - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   403
    by (simp add: dist_norm norm_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   404
  moreover have "0 < x \<bullet> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   405
    using u x by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   406
  ultimately have less: "c \<bullet> b < x \<bullet> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   407
    by (simp add: x algebra_simps inner_commute u)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   408
  assume "dist c b \<le> dist c x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   409
  then have "(c - b) \<bullet> (c - b) \<le> (c - x) \<bullet> (c - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   410
    by (simp add: dist_norm norm_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   411
  then have "(b \<bullet> b) * (1 - u*u) \<le> 2 * (b \<bullet> c) * (1-u)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   412
    by (simp add: x algebra_simps inner_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   413
  then have "(1+u) * (b \<bullet> b) * (1-u) \<le> 2 * (b \<bullet> c) * (1-u)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   414
    by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   415
  then have "(1+u) * (b \<bullet> b) \<le> 2 * (b \<bullet> c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   416
    using \<open>u < 1\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   417
  with xb have "c \<bullet> b \<ge> x \<bullet> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   418
    by (auto simp: x algebra_simps inner_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   419
  with less show False by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   420
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   421
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   422
proposition dist_decreases_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   423
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   424
  assumes "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   425
    shows "dist c x < dist c a \<or> dist c x < dist c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   426
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   427
  have *: "x - a \<in> open_segment 0 (b - a)" using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   428
    by (metis diff_self open_segment_translation_eq uminus_add_conv_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   429
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   430
    using dist_decreases_open_segment_0 [OF *, of "c-a"] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   431
    by (simp add: dist_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   432
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   433
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   434
corollary open_segment_furthest_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   435
  fixes a b x y :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   436
  assumes "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   437
  shows "norm (y - x) < norm (y - a) \<or>  norm (y - x) < norm (y - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   438
  by (metis assms dist_decreases_open_segment dist_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   439
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   440
corollary dist_decreases_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   441
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   442
  assumes "x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   443
    shows "dist c x \<le> dist c a \<or> dist c x \<le> dist c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   444
apply (cases "x \<in> open_segment a b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   445
 using dist_decreases_open_segment less_eq_real_def apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   446
by (metis DiffI assms empty_iff insertE open_segment_def order_refl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   447
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   448
lemma convex_intermediate_ball:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   449
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   450
  shows "\<lbrakk>ball a r \<subseteq> T; T \<subseteq> cball a r\<rbrakk> \<Longrightarrow> convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   451
apply (simp add: convex_contains_open_segment, clarify)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   452
by (metis (no_types, hide_lams) less_le_trans mem_ball mem_cball subsetCE dist_decreases_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   453
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   454
lemma csegment_midpoint_subset: "closed_segment (midpoint a b) b \<subseteq> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   455
  apply (clarsimp simp: midpoint_def in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   456
  apply (rule_tac x="(1 + u) / 2" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   457
  apply (auto simp: algebra_simps add_divide_distrib diff_divide_distrib)
68527
2f4e2aab190a Generalising and renaming some basic results
paulson <lp15@cam.ac.uk>
parents: 68465
diff changeset
   458
  by (metis field_sum_of_halves scaleR_left.add)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   459
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   460
lemma notin_segment_midpoint:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   461
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   462
  shows "a \<noteq> b \<Longrightarrow> a \<notin> closed_segment (midpoint a b) b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   463
by (auto simp: dist_midpoint dest!: dist_in_closed_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   464
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   465
lemma segment_to_closest_point:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   466
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   467
  shows "\<lbrakk>closed S; S \<noteq> {}\<rbrakk> \<Longrightarrow> open_segment a (closest_point S a) \<inter> S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   468
  apply (subst disjoint_iff_not_equal)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   469
  apply (clarify dest!: dist_in_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   470
  by (metis closest_point_le dist_commute le_less_trans less_irrefl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   471
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   472
lemma segment_to_point_exists:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   473
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   474
    assumes "closed S" "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   475
    obtains b where "b \<in> S" "open_segment a b \<inter> S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   476
  by (metis assms segment_to_closest_point closest_point_exists that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   477
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   478
subsubsection\<open>More lemmas, especially for working with the underlying formula\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   479
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   480
lemma segment_eq_compose:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   481
  fixes a :: "'a :: real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   482
  shows "(\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) = (\<lambda>x. a + x) o (\<lambda>u. u *\<^sub>R (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   483
    by (simp add: o_def algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   484
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   485
lemma segment_degen_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   486
  fixes a :: "'a :: real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   487
  shows "(1 - u) *\<^sub>R a + u *\<^sub>R b = b \<longleftrightarrow> a=b \<or> u=1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   488
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   489
  { assume "(1 - u) *\<^sub>R a + u *\<^sub>R b = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   490
    then have "(1 - u) *\<^sub>R a = (1 - u) *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   491
      by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   492
    then have "a=b \<or> u=1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   493
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   494
  } then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   495
      by (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   496
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   497
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   498
lemma segment_degen_0:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   499
    fixes a :: "'a :: real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   500
    shows "(1 - u) *\<^sub>R a + u *\<^sub>R b = a \<longleftrightarrow> a=b \<or> u=0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   501
  using segment_degen_1 [of "1-u" b a]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   502
  by (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   503
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   504
lemma add_scaleR_degen:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   505
  fixes a b ::"'a::real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   506
  assumes  "(u *\<^sub>R b + v *\<^sub>R a) = (u *\<^sub>R a + v *\<^sub>R b)"  "u \<noteq> v"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   507
  shows "a=b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   508
  by (metis (no_types, hide_lams) add.commute add_diff_eq diff_add_cancel real_vector.scale_cancel_left real_vector.scale_left_diff_distrib assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   509
  
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   510
lemma closed_segment_image_interval:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   511
     "closed_segment a b = (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0..1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   512
  by (auto simp: set_eq_iff image_iff closed_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   513
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   514
lemma open_segment_image_interval:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   515
     "open_segment a b = (if a=b then {} else (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   516
  by (auto simp:  open_segment_def closed_segment_def segment_degen_0 segment_degen_1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   517
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   518
lemmas segment_image_interval = closed_segment_image_interval open_segment_image_interval
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   519
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   520
lemma open_segment_bound1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   521
  assumes "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   522
  shows "norm (x - a) < norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   523
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   524
  obtain u where "x = (1 - u) *\<^sub>R a + u *\<^sub>R b" "0 < u" "u < 1" "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   525
    using assms by (auto simp add: open_segment_image_interval split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   526
  then show "norm (x - a) < norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   527
    apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   528
    apply (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   529
    apply (simp add: scaleR_diff_right [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   530
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   531
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   532
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   533
lemma compact_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   534
  fixes a :: "'a::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   535
  shows "compact (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   536
  by (auto simp: segment_image_interval intro!: compact_continuous_image continuous_intros)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   537
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   538
lemma closed_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   539
  fixes a :: "'a::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   540
  shows "closed (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   541
  by (simp add: compact_imp_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   542
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   543
lemma closure_closed_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   544
  fixes a :: "'a::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   545
  shows "closure(closed_segment a b) = closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   546
  by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   547
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   548
lemma open_segment_bound:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   549
  assumes "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   550
  shows "norm (x - a) < norm (b - a)" "norm (x - b) < norm (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   551
apply (simp add: assms open_segment_bound1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   552
by (metis assms norm_minus_commute open_segment_bound1 open_segment_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   553
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   554
lemma closure_open_segment [simp]:
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   555
  "closure (open_segment a b) = (if a = b then {} else closed_segment a b)"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   556
    for a :: "'a::euclidean_space"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   557
proof (cases "a = b")
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   558
  case True
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   559
  then show ?thesis
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   560
    by simp
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   561
next
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   562
  case False
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   563
  have "closure ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1}) = (\<lambda>u. u *\<^sub>R (b - a)) ` closure {0<..<1}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   564
    apply (rule closure_injective_linear_image [symmetric])
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   565
     apply (use False in \<open>auto intro!: injI\<close>)
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   566
    done
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   567
  then have "closure
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   568
     ((\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) ` {0<..<1}) =
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   569
    (\<lambda>x. (1 - x) *\<^sub>R a + x *\<^sub>R b) ` closure {0<..<1}"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   570
    using closure_translation [of a "((\<lambda>x. x *\<^sub>R b - x *\<^sub>R a) ` {0<..<1})"]
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   571
    by (simp add: segment_eq_compose field_simps scaleR_diff_left scaleR_diff_right image_image)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   572
  then show ?thesis
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   573
    by (simp add: segment_image_interval closure_greaterThanLessThan [symmetric] del: closure_greaterThanLessThan)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   574
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   575
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   576
lemma closed_open_segment_iff [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   577
    fixes a :: "'a::euclidean_space"  shows "closed(open_segment a b) \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   578
  by (metis open_segment_def DiffE closure_eq closure_open_segment ends_in_segment(1) insert_iff segment_image_interval(2))
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   579
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   580
lemma compact_open_segment_iff [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   581
    fixes a :: "'a::euclidean_space"  shows "compact(open_segment a b) \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   582
  by (simp add: bounded_open_segment compact_eq_bounded_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   583
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   584
lemma convex_closed_segment [iff]: "convex (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   585
  unfolding segment_convex_hull by(rule convex_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   586
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   587
lemma convex_open_segment [iff]: "convex (open_segment a b)"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   588
proof -
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   589
  have "convex ((\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   590
    by (rule convex_linear_image) auto
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   591
  then have "convex ((+) a ` (\<lambda>u. u *\<^sub>R (b - a)) ` {0<..<1})"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   592
    by (rule convex_translation)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   593
  then show ?thesis
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
   594
    by (simp add: image_image open_segment_image_interval segment_eq_compose field_simps scaleR_diff_left scaleR_diff_right)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   595
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   596
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   597
lemmas convex_segment = convex_closed_segment convex_open_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   598
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   599
lemma connected_segment [iff]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   600
  fixes x :: "'a :: real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   601
  shows "connected (closed_segment x y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   602
  by (simp add: convex_connected)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   603
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   604
lemma is_interval_closed_segment_1[intro, simp]: "is_interval (closed_segment a b)" for a b::real
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   605
  by (auto simp: is_interval_convex_1)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   606
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   607
lemma IVT'_closed_segment_real:
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   608
  fixes f :: "real \<Rightarrow> real"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   609
  assumes "y \<in> closed_segment (f a) (f b)"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   610
  assumes "continuous_on (closed_segment a b) f"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   611
  shows "\<exists>x \<in> closed_segment a b. f x = y"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   612
  using IVT'[of f a y b]
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   613
    IVT'[of "-f" a "-y" b]
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   614
    IVT'[of f b y a]
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   615
    IVT'[of "-f" b "-y" a] assms
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   616
  by (cases "a \<le> b"; cases "f b \<ge> f a") (auto simp: closed_segment_eq_real_ivl continuous_on_minus)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   617
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   618
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   619
subsection\<open>Starlike sets\<close>
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   620
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   621
definition\<^marker>\<open>tag important\<close> "starlike S \<longleftrightarrow> (\<exists>a\<in>S. \<forall>x\<in>S. closed_segment a x \<subseteq> S)"
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   622
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   623
lemma starlike_UNIV [simp]: "starlike UNIV"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   624
  by (simp add: starlike_def)
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   625
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   626
lemma convex_imp_starlike:
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   627
  "convex S \<Longrightarrow> S \<noteq> {} \<Longrightarrow> starlike S"
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   628
  unfolding convex_contains_segment starlike_def by auto
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   629
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67613
diff changeset
   630
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   631
lemma affine_hull_closed_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   632
     "affine hull (closed_segment a b) = affine hull {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   633
  by (simp add: segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   634
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   635
lemma affine_hull_open_segment [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   636
    fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   637
    shows "affine hull (open_segment a b) = (if a = b then {} else affine hull {a,b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   638
by (metis affine_hull_convex_hull affine_hull_empty closure_open_segment closure_same_affine_hull segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   639
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   640
lemma rel_interior_closure_convex_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   641
  fixes S :: "_::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   642
  assumes "convex S" "a \<in> rel_interior S" "b \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   643
    shows "open_segment a b \<subseteq> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   644
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   645
  fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   646
  have [simp]: "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)" for u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   647
    by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   648
  assume "x \<in> open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   649
  then show "x \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   650
    unfolding closed_segment_def open_segment_def  using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   651
    by (auto intro: rel_interior_closure_convex_shrink)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   652
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   653
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   654
lemma convex_hull_insert_segments:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   655
   "convex hull (insert a S) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   656
    (if S = {} then {a} else  \<Union>x \<in> convex hull S. closed_segment a x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   657
  by (force simp add: convex_hull_insert_alt in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   658
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   659
lemma Int_convex_hull_insert_rel_exterior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   660
  fixes z :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   661
  assumes "convex C" "T \<subseteq> C" and z: "z \<in> rel_interior C" and dis: "disjnt S (rel_interior C)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   662
  shows "S \<inter> (convex hull (insert z T)) = S \<inter> (convex hull T)" (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   663
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   664
  have "T = {} \<Longrightarrow> z \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   665
    using dis z by (auto simp add: disjnt_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   666
  then show "?lhs \<subseteq> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   667
  proof (clarsimp simp add: convex_hull_insert_segments)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   668
    fix x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   669
    assume "x \<in> S" and y: "y \<in> convex hull T" and "x \<in> closed_segment z y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   670
    have "y \<in> closure C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   671
      by (metis y \<open>convex C\<close> \<open>T \<subseteq> C\<close> closure_subset contra_subsetD convex_hull_eq hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   672
    moreover have "x \<notin> rel_interior C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   673
      by (meson \<open>x \<in> S\<close> dis disjnt_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   674
    moreover have "x \<in> open_segment z y \<union> {z, y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   675
      using \<open>x \<in> closed_segment z y\<close> closed_segment_eq_open by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   676
    ultimately show "x \<in> convex hull T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   677
      using rel_interior_closure_convex_segment [OF \<open>convex C\<close> z]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   678
      using y z by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   679
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   680
  show "?rhs \<subseteq> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   681
    by (meson hull_mono inf_mono subset_insertI subset_refl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   682
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   683
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   684
subsection\<^marker>\<open>tag unimportant\<close>\<open>More results about segments\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   685
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   686
lemma dist_half_times2:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   687
  fixes a :: "'a :: real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   688
  shows "dist ((1 / 2) *\<^sub>R (a + b)) x * 2 = dist (a+b) (2 *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   689
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   690
  have "norm ((1 / 2) *\<^sub>R (a + b) - x) * 2 = norm (2 *\<^sub>R ((1 / 2) *\<^sub>R (a + b) - x))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   691
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   692
  also have "... = norm ((a + b) - 2 *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   693
    by (simp add: real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   694
  finally show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   695
    by (simp only: dist_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   696
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   697
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   698
lemma closed_segment_as_ball:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   699
    "closed_segment a b = affine hull {a,b} \<inter> cball(inverse 2 *\<^sub>R (a + b))(norm(b - a) / 2)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   700
proof (cases "b = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   701
  case True then show ?thesis by (auto simp: hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   702
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   703
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   704
  then have *: "((\<exists>u v. x = u *\<^sub>R a + v *\<^sub>R b \<and> u + v = 1) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   705
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 \<le> norm (b - a)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   706
                 (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1)" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   707
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   708
    have "((\<exists>u v. x = u *\<^sub>R a + v *\<^sub>R b \<and> u + v = 1) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   709
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 \<le> norm (b - a)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   710
          ((\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   711
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 \<le> norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   712
      unfolding eq_diff_eq [symmetric] by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   713
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   714
                          norm ((a+b) - (2 *\<^sub>R x)) \<le> norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   715
      by (simp add: dist_half_times2) (simp add: dist_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   716
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   717
            norm ((a+b) - (2 *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b))) \<le> norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   718
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   719
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   720
                norm ((1 - u * 2) *\<^sub>R (b - a)) \<le> norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   721
      by (simp add: algebra_simps scaleR_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   722
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   723
                          \<bar>1 - u * 2\<bar> * norm (b - a) \<le> norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   724
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   725
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> \<bar>1 - u * 2\<bar> \<le> 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   726
      by (simp add: mult_le_cancel_right2 False)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   727
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   728
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   729
    finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   730
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   731
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   732
    by (simp add: affine_hull_2 Set.set_eq_iff closed_segment_def *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   733
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   734
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   735
lemma open_segment_as_ball:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   736
    "open_segment a b =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   737
     affine hull {a,b} \<inter> ball(inverse 2 *\<^sub>R (a + b))(norm(b - a) / 2)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   738
proof (cases "b = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   739
  case True then show ?thesis by (auto simp: hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   740
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   741
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   742
  then have *: "((\<exists>u v. x = u *\<^sub>R a + v *\<^sub>R b \<and> u + v = 1) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   743
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 < norm (b - a)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   744
                 (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 < u \<and> u < 1)" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   745
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   746
    have "((\<exists>u v. x = u *\<^sub>R a + v *\<^sub>R b \<and> u + v = 1) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   747
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 < norm (b - a)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   748
          ((\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   749
                  dist ((1 / 2) *\<^sub>R (a + b)) x * 2 < norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   750
      unfolding eq_diff_eq [symmetric] by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   751
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   752
                          norm ((a+b) - (2 *\<^sub>R x)) < norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   753
      by (simp add: dist_half_times2) (simp add: dist_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   754
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   755
            norm ((a+b) - (2 *\<^sub>R ((1 - u) *\<^sub>R a + u *\<^sub>R b))) < norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   756
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   757
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   758
                norm ((1 - u * 2) *\<^sub>R (b - a)) < norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   759
      by (simp add: algebra_simps scaleR_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   760
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   761
                          \<bar>1 - u * 2\<bar> * norm (b - a) < norm (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   762
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   763
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> \<bar>1 - u * 2\<bar> < 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   764
      by (simp add: mult_le_cancel_right2 False)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   765
    also have "... = (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 < u \<and> u < 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   766
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   767
    finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   768
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   769
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   770
    using False by (force simp: affine_hull_2 Set.set_eq_iff open_segment_image_interval *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   771
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   772
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   773
lemmas segment_as_ball = closed_segment_as_ball open_segment_as_ball
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   774
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   775
lemma closed_segment_neq_empty [simp]: "closed_segment a b \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   776
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   777
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   778
lemma open_segment_eq_empty [simp]: "open_segment a b = {} \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   779
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   780
  { assume a1: "open_segment a b = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   781
    have "{} \<noteq> {0::real<..<1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   782
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   783
    then have "a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   784
      using a1 open_segment_image_interval by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   785
  } then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   786
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   787
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   788
lemma open_segment_eq_empty' [simp]: "{} = open_segment a b \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   789
  using open_segment_eq_empty by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   790
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   791
lemmas segment_eq_empty = closed_segment_neq_empty open_segment_eq_empty
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   792
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   793
lemma inj_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   794
  fixes a :: "'a :: real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   795
  assumes "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   796
    shows "inj_on (\<lambda>u. (1 - u) *\<^sub>R a + u *\<^sub>R b) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   797
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   798
  fix x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   799
  assume "(1 - x) *\<^sub>R a + x *\<^sub>R b = (1 - y) *\<^sub>R a + y *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   800
  then have "x *\<^sub>R (b - a) = y *\<^sub>R (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   801
    by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   802
  with assms show "x = y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   803
    by (simp add: real_vector.scale_right_imp_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   804
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   805
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   806
lemma finite_closed_segment [simp]: "finite(closed_segment a b) \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   807
  apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   808
  apply (rule ccontr)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   809
  apply (simp add: segment_image_interval)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   810
  using infinite_Icc [OF zero_less_one] finite_imageD [OF _ inj_segment] apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   811
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   812
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   813
lemma finite_open_segment [simp]: "finite(open_segment a b) \<longleftrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   814
  by (auto simp: open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   815
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   816
lemmas finite_segment = finite_closed_segment finite_open_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   817
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   818
lemma closed_segment_eq_sing: "closed_segment a b = {c} \<longleftrightarrow> a = c \<and> b = c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   819
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   820
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   821
lemma open_segment_eq_sing: "open_segment a b \<noteq> {c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   822
  by (metis finite_insert finite_open_segment insert_not_empty open_segment_image_interval)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   823
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   824
lemmas segment_eq_sing = closed_segment_eq_sing open_segment_eq_sing
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   825
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   826
lemma subset_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   827
    "closed_segment a b \<subseteq> closed_segment c d \<longleftrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   828
     a \<in> closed_segment c d \<and> b \<in> closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   829
  by auto (meson contra_subsetD convex_closed_segment convex_contains_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   830
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   831
lemma subset_co_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   832
    "closed_segment a b \<subseteq> open_segment c d \<longleftrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   833
     a \<in> open_segment c d \<and> b \<in> open_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   834
using closed_segment_subset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   835
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   836
lemma subset_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   837
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   838
  shows "open_segment a b \<subseteq> open_segment c d \<longleftrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   839
         a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   840
        (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   841
proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   842
  case True then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   843
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   844
  case False show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   845
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   846
    assume rhs: ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   847
    with \<open>a \<noteq> b\<close> have "c \<noteq> d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   848
      using closed_segment_idem singleton_iff by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   849
    have "\<exists>uc. (1 - u) *\<^sub>R ((1 - ua) *\<^sub>R c + ua *\<^sub>R d) + u *\<^sub>R ((1 - ub) *\<^sub>R c + ub *\<^sub>R d) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   850
               (1 - uc) *\<^sub>R c + uc *\<^sub>R d \<and> 0 < uc \<and> uc < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   851
        if neq: "(1 - ua) *\<^sub>R c + ua *\<^sub>R d \<noteq> (1 - ub) *\<^sub>R c + ub *\<^sub>R d" "c \<noteq> d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   852
           and "a = (1 - ua) *\<^sub>R c + ua *\<^sub>R d" "b = (1 - ub) *\<^sub>R c + ub *\<^sub>R d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   853
           and u: "0 < u" "u < 1" and uab: "0 \<le> ua" "ua \<le> 1" "0 \<le> ub" "ub \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   854
        for u ua ub
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   855
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   856
      have "ua \<noteq> ub"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   857
        using neq by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   858
      moreover have "(u - 1) * ua \<le> 0" using u uab
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   859
        by (simp add: mult_nonpos_nonneg)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   860
      ultimately have lt: "(u - 1) * ua < u * ub" using u uab
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   861
        by (metis antisym_conv diff_ge_0_iff_ge le_less_trans mult_eq_0_iff mult_le_0_iff not_less)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   862
      have "p * ua + q * ub < p+q" if p: "0 < p" and  q: "0 < q" for p q
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   863
      proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   864
        have "\<not> p \<le> 0" "\<not> q \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   865
          using p q not_less by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   866
        then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   867
          by (metis \<open>ua \<noteq> ub\<close> add_less_cancel_left add_less_cancel_right add_mono_thms_linordered_field(5)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   868
                    less_eq_real_def mult_cancel_left1 mult_less_cancel_left2 uab(2) uab(4))
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   869
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   870
      then have "(1 - u) * ua + u * ub < 1" using u \<open>ua \<noteq> ub\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   871
        by (metis diff_add_cancel diff_gt_0_iff_gt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   872
      with lt show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   873
        by (rule_tac x="ua + u*(ub-ua)" in exI) (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   874
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   875
    with rhs \<open>a \<noteq> b\<close> \<open>c \<noteq> d\<close> show ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   876
      unfolding open_segment_image_interval closed_segment_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   877
      by (fastforce simp add:)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   878
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   879
    assume lhs: ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   880
    with \<open>a \<noteq> b\<close> have "c \<noteq> d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   881
      by (meson finite_open_segment rev_finite_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   882
    have "closure (open_segment a b) \<subseteq> closure (open_segment c d)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   883
      using lhs closure_mono by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   884
    then have "closed_segment a b \<subseteq> closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   885
      by (simp add: \<open>a \<noteq> b\<close> \<open>c \<noteq> d\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   886
    then show ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   887
      by (force simp: \<open>a \<noteq> b\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   888
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   889
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   890
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   891
lemma subset_oc_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   892
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   893
  shows "open_segment a b \<subseteq> closed_segment c d \<longleftrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   894
         a = b \<or> a \<in> closed_segment c d \<and> b \<in> closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   895
apply (simp add: subset_open_segment [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   896
apply (rule iffI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   897
 apply (metis closure_closed_segment closure_mono closure_open_segment subset_closed_segment subset_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   898
apply (meson dual_order.trans segment_open_subset_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   899
done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   900
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   901
lemmas subset_segment = subset_closed_segment subset_co_segment subset_oc_segment subset_open_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   902
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   903
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   904
subsection\<open>Betweenness\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   905
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
   906
definition\<^marker>\<open>tag important\<close> "between = (\<lambda>(a,b) x. x \<in> closed_segment a b)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   907
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   908
lemma betweenI:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   909
  assumes "0 \<le> u" "u \<le> 1" "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   910
  shows "between (a, b) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   911
using assms unfolding between_def closed_segment_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   912
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   913
lemma betweenE:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   914
  assumes "between (a, b) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   915
  obtains u where "0 \<le> u" "u \<le> 1" "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   916
using assms unfolding between_def closed_segment_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   917
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   918
lemma between_implies_scaled_diff:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   919
  assumes "between (S, T) X" "between (S, T) Y" "S \<noteq> Y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   920
  obtains c where "(X - Y) = c *\<^sub>R (S - Y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   921
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   922
  from \<open>between (S, T) X\<close> obtain u\<^sub>X where X: "X = u\<^sub>X *\<^sub>R S + (1 - u\<^sub>X) *\<^sub>R T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   923
    by (metis add.commute betweenE eq_diff_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   924
  from \<open>between (S, T) Y\<close> obtain u\<^sub>Y where Y: "Y = u\<^sub>Y *\<^sub>R S + (1 - u\<^sub>Y) *\<^sub>R T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   925
    by (metis add.commute betweenE eq_diff_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   926
  have "X - Y = (u\<^sub>X - u\<^sub>Y) *\<^sub>R (S - T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   927
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   928
    from X Y have "X - Y =  u\<^sub>X *\<^sub>R S - u\<^sub>Y *\<^sub>R S + ((1 - u\<^sub>X) *\<^sub>R T - (1 - u\<^sub>Y) *\<^sub>R T)" by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   929
    also have "\<dots> = (u\<^sub>X - u\<^sub>Y) *\<^sub>R S - (u\<^sub>X - u\<^sub>Y) *\<^sub>R T" by (simp add: scaleR_left.diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   930
    finally show ?thesis by (simp add: real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   931
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   932
  moreover from Y have "S - Y = (1 - u\<^sub>Y) *\<^sub>R (S - T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   933
    by (simp add: real_vector.scale_left_diff_distrib real_vector.scale_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   934
  moreover note \<open>S \<noteq> Y\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   935
  ultimately have "(X - Y) = ((u\<^sub>X - u\<^sub>Y) / (1 - u\<^sub>Y)) *\<^sub>R (S - Y)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   936
  from this that show thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   937
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   938
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   939
lemma between_mem_segment: "between (a,b) x \<longleftrightarrow> x \<in> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   940
  unfolding between_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   941
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   942
lemma between: "between (a, b) (x::'a::euclidean_space) \<longleftrightarrow> dist a b = (dist a x) + (dist x b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   943
proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   944
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   945
  then show ?thesis
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   946
    by (auto simp add: between_def dist_commute)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   947
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   948
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   949
  then have Fal: "norm (a - b) \<noteq> 0" and Fal2: "norm (a - b) > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   950
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   951
  have *: "\<And>u. a - ((1 - u) *\<^sub>R a + u *\<^sub>R b) = u *\<^sub>R (a - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   952
    by (auto simp add: algebra_simps)
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   953
  have "norm (a - x) *\<^sub>R (x - b) = norm (x - b) *\<^sub>R (a - x)" if "x = (1 - u) *\<^sub>R a + u *\<^sub>R b" "0 \<le> u" "u \<le> 1" for u
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   954
  proof -
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   955
    have *: "a - x = u *\<^sub>R (a - b)" "x - b = (1 - u) *\<^sub>R (a - b)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   956
      unfolding that(1) by (auto simp add:algebra_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   957
    show "norm (a - x) *\<^sub>R (x - b) = norm (x - b) *\<^sub>R (a - x)"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   958
      unfolding norm_minus_commute[of x a] * using \<open>0 \<le> u\<close> \<open>u \<le> 1\<close>
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70620
diff changeset
   959
      by simp
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   960
  qed
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   961
  moreover have "\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1" if "dist a b = dist a x + dist x b" 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   962
  proof -
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   963
    let ?\<beta> = "norm (a - x) / norm (a - b)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   964
    show "\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> u \<and> u \<le> 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   965
    proof (intro exI conjI)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   966
      show "?\<beta> \<le> 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   967
        using Fal2 unfolding that[unfolded dist_norm] norm_ge_zero by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   968
      show "x = (1 - ?\<beta>) *\<^sub>R a + (?\<beta>) *\<^sub>R b"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   969
      proof (subst euclidean_eq_iff; intro ballI)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   970
        fix i :: 'a
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   971
        assume i: "i \<in> Basis"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   972
        have "((1 - ?\<beta>) *\<^sub>R a + (?\<beta>) *\<^sub>R b) \<bullet> i 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   973
              = ((norm (a - b) - norm (a - x)) * (a \<bullet> i) + norm (a - x) * (b \<bullet> i)) / norm (a - b)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   974
          using Fal by (auto simp add: field_simps inner_simps)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   975
        also have "\<dots> = x\<bullet>i"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   976
          apply (rule divide_eq_imp[OF Fal])
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   977
          unfolding that[unfolded dist_norm]
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   978
          using that[unfolded dist_triangle_eq] i
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   979
          apply (subst (asm) euclidean_eq_iff)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   980
           apply (auto simp add: field_simps inner_simps)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   981
          done
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   982
        finally show "x \<bullet> i = ((1 - ?\<beta>) *\<^sub>R a + (?\<beta>) *\<^sub>R b) \<bullet> i"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   983
          by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   984
      qed
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   985
    qed (use Fal2 in auto)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   986
  qed
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   987
  ultimately show ?thesis
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
   988
    by (force simp add: between_def closed_segment_def dist_triangle_eq)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   989
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   990
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   991
lemma between_midpoint:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   992
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   993
  shows "between (a,b) (midpoint a b)" (is ?t1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   994
    and "between (b,a) (midpoint a b)" (is ?t2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   995
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   996
  have *: "\<And>x y z. x = (1/2::real) *\<^sub>R z \<Longrightarrow> y = (1/2) *\<^sub>R z \<Longrightarrow> norm z = norm x + norm y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   997
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   998
  show ?t1 ?t2
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   999
    unfolding between midpoint_def dist_norm
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1000
    by (auto simp add: field_simps inner_simps euclidean_eq_iff[where 'a='a] intro!: *)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1001
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1002
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1003
lemma between_mem_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1004
  "between (a,b) x \<longleftrightarrow> x \<in> convex hull {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1005
  unfolding between_mem_segment segment_convex_hull ..
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1006
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1007
lemma between_triv_iff [simp]: "between (a,a) b \<longleftrightarrow> a=b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1008
  by (auto simp: between_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1009
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1010
lemma between_triv1 [simp]: "between (a,b) a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1011
  by (auto simp: between_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1012
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1013
lemma between_triv2 [simp]: "between (a,b) b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1014
  by (auto simp: between_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1015
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1016
lemma between_commute:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1017
   "between (a,b) = between (b,a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1018
by (auto simp: between_def closed_segment_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1019
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1020
lemma between_antisym:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1021
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1022
  shows "\<lbrakk>between (b,c) a; between (a,c) b\<rbrakk> \<Longrightarrow> a = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1023
by (auto simp: between dist_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1024
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1025
lemma between_trans:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1026
    fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1027
    shows "\<lbrakk>between (b,c) a; between (a,c) d\<rbrakk> \<Longrightarrow> between (b,c) d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1028
  using dist_triangle2 [of b c d] dist_triangle3 [of b d a]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1029
  by (auto simp: between dist_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1030
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1031
lemma between_norm:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1032
    fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1033
    shows "between (a,b) x \<longleftrightarrow> norm(x - a) *\<^sub>R (b - x) = norm(b - x) *\<^sub>R (x - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1034
  by (auto simp: between dist_triangle_eq norm_minus_commute algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1035
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1036
lemma between_swap:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1037
  fixes A B X Y :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1038
  assumes "between (A, B) X"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1039
  assumes "between (A, B) Y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1040
  shows "between (X, B) Y \<longleftrightarrow> between (A, Y) X"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1041
using assms by (auto simp add: between)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1042
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1043
lemma between_translation [simp]: "between (a + y,a + z) (a + x) \<longleftrightarrow> between (y,z) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1044
  by (auto simp: between_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1045
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1046
lemma between_trans_2:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1047
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1048
  shows "\<lbrakk>between (b,c) a; between (a,b) d\<rbrakk> \<Longrightarrow> between (c,d) a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1049
  by (metis between_commute between_swap between_trans)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1050
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1051
lemma between_scaleR_lift [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1052
  fixes v :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1053
  shows "between (a *\<^sub>R v, b *\<^sub>R v) (c *\<^sub>R v) \<longleftrightarrow> v = 0 \<or> between (a, b) c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1054
  by (simp add: between dist_norm scaleR_left_diff_distrib [symmetric] distrib_right [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1055
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1056
lemma between_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1057
  fixes x::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1058
  shows "between (a,b) x \<longleftrightarrow> (a \<le> x \<and> x \<le> b) \<or> (b \<le> x \<and> x \<le> a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1059
  by (auto simp: between_mem_segment closed_segment_eq_real_ivl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1060
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1061
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  1062
subsection\<^marker>\<open>tag unimportant\<close> \<open>Shrinking towards the interior of a convex set\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1063
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1064
lemma mem_interior_convex_shrink:
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1065
  fixes S :: "'a::euclidean_space set"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1066
  assumes "convex S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1067
    and "c \<in> interior S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1068
    and "x \<in> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1069
    and "0 < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1070
    and "e \<le> 1"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1071
  shows "x - e *\<^sub>R (x - c) \<in> interior S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1072
proof -
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1073
  obtain d where "d > 0" and d: "ball c d \<subseteq> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1074
    using assms(2) unfolding mem_interior by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1075
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1076
    unfolding mem_interior
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1077
  proof (intro exI subsetI conjI)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1078
    fix y
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1079
    assume "y \<in> ball (x - e *\<^sub>R (x - c)) (e*d)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1080
    then have as: "dist (x - e *\<^sub>R (x - c)) y < e * d"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1081
      by simp
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1082
    have *: "y = (1 - (1 - e)) *\<^sub>R ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) + (1 - e) *\<^sub>R x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1083
      using \<open>e > 0\<close> by (auto simp add: scaleR_left_diff_distrib scaleR_right_diff_distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1084
    have "dist c ((1 / e) *\<^sub>R y - ((1 - e) / e) *\<^sub>R x) = \<bar>1/e\<bar> * norm (e *\<^sub>R c - y + (1 - e) *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1085
      unfolding dist_norm
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1086
      unfolding norm_scaleR[symmetric]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1087
      apply (rule arg_cong[where f=norm])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1088
      using \<open>e > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1089
      by (auto simp add: euclidean_eq_iff[where 'a='a] field_simps inner_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1090
    also have "\<dots> = \<bar>1/e\<bar> * norm (x - e *\<^sub>R (x - c) - y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1091
      by (auto intro!:arg_cong[where f=norm] simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1092
    also have "\<dots> < d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1093
      using as[unfolded dist_norm] and \<open>e > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1094
      by (auto simp add:pos_divide_less_eq[OF \<open>e > 0\<close>] mult.commute)
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1095
    finally show "y \<in> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1096
      apply (subst *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1097
      apply (rule assms(1)[unfolded convex_alt,rule_format])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1098
      apply (rule d[unfolded subset_eq,rule_format])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1099
      unfolding mem_ball
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1100
      using assms(3-5)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1101
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1102
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1103
  qed (insert \<open>e>0\<close> \<open>d>0\<close>, auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1104
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1105
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1106
lemma mem_interior_closure_convex_shrink:
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1107
  fixes S :: "'a::euclidean_space set"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1108
  assumes "convex S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1109
    and "c \<in> interior S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1110
    and "x \<in> closure S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1111
    and "0 < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1112
    and "e \<le> 1"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1113
  shows "x - e *\<^sub>R (x - c) \<in> interior S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1114
proof -
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1115
  obtain d where "d > 0" and d: "ball c d \<subseteq> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1116
    using assms(2) unfolding mem_interior by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1117
  have "\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1118
  proof (cases "x \<in> S")
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1119
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1120
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1121
      using \<open>e > 0\<close> \<open>d > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1122
      apply (rule_tac bexI[where x=x])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1123
      apply (auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1124
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1125
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1126
    case False
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1127
    then have x: "x islimpt S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1128
      using assms(3)[unfolded closure_def] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1129
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1130
    proof (cases "e = 1")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1131
      case True
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1132
      obtain y where "y \<in> S" "y \<noteq> x" "dist y x < 1"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1133
        using x[unfolded islimpt_approachable,THEN spec[where x=1]] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1134
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1135
        apply (rule_tac x=y in bexI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1136
        unfolding True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1137
        using \<open>d > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1138
        apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1139
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1140
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1141
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1142
      then have "0 < e * d / (1 - e)" and *: "1 - e > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1143
        using \<open>e \<le> 1\<close> \<open>e > 0\<close> \<open>d > 0\<close> by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1144
      then obtain y where "y \<in> S" "y \<noteq> x" "dist y x < e * d / (1 - e)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1145
        using x[unfolded islimpt_approachable,THEN spec[where x="e*d / (1 - e)"]] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1146
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1147
        apply (rule_tac x=y in bexI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1148
        unfolding dist_norm
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1149
        using pos_less_divide_eq[OF *]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1150
        apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1151
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1152
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1153
  qed
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1154
  then obtain y where "y \<in> S" and y: "norm (y - x) * (1 - e) < e * d"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1155
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1156
  define z where "z = c + ((1 - e) / e) *\<^sub>R (x - y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1157
  have *: "x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1158
    unfolding z_def using \<open>e > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1159
    by (auto simp add: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib)
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1160
  have "z \<in> interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1161
    apply (rule interior_mono[OF d,unfolded subset_eq,rule_format])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1162
    unfolding interior_open[OF open_ball] mem_ball z_def dist_norm using y and assms(4,5)
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70620
diff changeset
  1163
    by simp (simp add: field_simps norm_minus_commute)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1164
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1165
    unfolding *
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1166
    using mem_interior_convex_shrink \<open>y \<in> S\<close> assms by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1167
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1168
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1169
lemma in_interior_closure_convex_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1170
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1171
  assumes "convex S" and a: "a \<in> interior S" and b: "b \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1172
    shows "open_segment a b \<subseteq> interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1173
proof (clarsimp simp: in_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1174
  fix u::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1175
  assume u: "0 < u" "u < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1176
  have "(1 - u) *\<^sub>R a + u *\<^sub>R b = b - (1 - u) *\<^sub>R (b - a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1177
    by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1178
  also have "... \<in> interior S" using mem_interior_closure_convex_shrink [OF assms] u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1179
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1180
  finally show "(1 - u) *\<^sub>R a + u *\<^sub>R b \<in> interior S" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1181
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1182
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1183
lemma closure_open_Int_superset:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1184
  assumes "open S" "S \<subseteq> closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1185
  shows "closure(S \<inter> T) = closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1186
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1187
  have "closure S \<subseteq> closure(S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1188
    by (metis assms closed_closure closure_minimal inf.orderE open_Int_closure_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1189
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1190
    by (simp add: closure_mono dual_order.antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1191
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1192
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1193
lemma convex_closure_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1194
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1195
  assumes "convex S" and int: "interior S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1196
  shows "closure(interior S) = closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1197
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1198
  obtain a where a: "a \<in> interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1199
    using int by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1200
  have "closure S \<subseteq> closure(interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1201
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1202
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1203
    assume x: "x \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1204
    show "x \<in> closure (interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1205
    proof (cases "x=a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1206
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1207
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1208
        using \<open>a \<in> interior S\<close> closure_subset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1209
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1210
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1211
      show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1212
      proof (clarsimp simp add: closure_def islimpt_approachable)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1213
        fix e::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1214
        assume xnotS: "x \<notin> interior S" and "0 < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1215
        show "\<exists>x'\<in>interior S. x' \<noteq> x \<and> dist x' x < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1216
        proof (intro bexI conjI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1217
          show "x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a) \<noteq> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1218
            using False \<open>0 < e\<close> by (auto simp: algebra_simps min_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1219
          show "dist (x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a)) x < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1220
            using \<open>0 < e\<close> by (auto simp: dist_norm min_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1221
          show "x - min (e/2 / norm (x - a)) 1 *\<^sub>R (x - a) \<in> interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1222
            apply (clarsimp simp add: min_def a)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1223
            apply (rule mem_interior_closure_convex_shrink [OF \<open>convex S\<close> a x])
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  1224
            using \<open>0 < e\<close> False apply (auto simp: field_split_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1225
            done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1226
        qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1227
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1228
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1229
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1230
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1231
    by (simp add: closure_mono interior_subset subset_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1232
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1233
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1234
lemma closure_convex_Int_superset:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1235
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1236
  assumes "convex S" "interior S \<noteq> {}" "interior S \<subseteq> closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1237
  shows "closure(S \<inter> T) = closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1238
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1239
  have "closure S \<subseteq> closure(interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1240
    by (simp add: convex_closure_interior assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1241
  also have "... \<subseteq> closure (S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1242
    using interior_subset [of S] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1243
    by (metis (no_types, lifting) Int_assoc Int_lower2 closure_mono closure_open_Int_superset inf.orderE open_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1244
  finally show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1245
    by (simp add: closure_mono dual_order.antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1246
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1247
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1248
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  1249
subsection\<^marker>\<open>tag unimportant\<close> \<open>Some obvious but surprisingly hard simplex lemmas\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1250
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1251
lemma simplex:
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1252
  assumes "finite S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1253
    and "0 \<notin> S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1254
  shows "convex hull (insert 0 S) = {y. \<exists>u. (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S \<le> 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) S = y}"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1255
proof (simp add: convex_hull_finite set_eq_iff assms, safe)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1256
  fix x and u :: "'a \<Rightarrow> real"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1257
  assume "0 \<le> u 0" "\<forall>x\<in>S. 0 \<le> u x" "u 0 + sum u S = 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1258
  then show "\<exists>v. (\<forall>x\<in>S. 0 \<le> v x) \<and> sum v S \<le> 1 \<and> (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1259
    by force
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1260
next
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1261
  fix x and u :: "'a \<Rightarrow> real"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1262
  assume "\<forall>x\<in>S. 0 \<le> u x" "sum u S \<le> 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1263
  then show "\<exists>v. 0 \<le> v 0 \<and> (\<forall>x\<in>S. 0 \<le> v x) \<and> v 0 + sum v S = 1 \<and> (\<Sum>x\<in>S. v x *\<^sub>R x) = (\<Sum>x\<in>S. u x *\<^sub>R x)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1264
    by (rule_tac x="\<lambda>x. if x = 0 then 1 - sum u S else u x" in exI) (auto simp: sum_delta_notmem assms if_smult)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1265
qed
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1266
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1267
lemma substd_simplex:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1268
  assumes d: "d \<subseteq> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1269
  shows "convex hull (insert 0 d) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1270
    {x. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> (\<Sum>i\<in>d. x\<bullet>i) \<le> 1 \<and> (\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x\<bullet>i = 0)}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1271
  (is "convex hull (insert 0 ?p) = ?s")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1272
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1273
  let ?D = d
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1274
  have "0 \<notin> ?p"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1275
    using assms by (auto simp: image_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1276
  from d have "finite d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1277
    by (blast intro: finite_subset finite_Basis)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1278
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1279
    unfolding simplex[OF \<open>finite d\<close> \<open>0 \<notin> ?p\<close>]
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1280
  proof (intro set_eqI; safe)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1281
    fix u :: "'a \<Rightarrow> real"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1282
    assume as: "\<forall>x\<in>?D. 0 \<le> u x" "sum u ?D \<le> 1" 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1283
    let ?x = "(\<Sum>x\<in>?D. u x *\<^sub>R x)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1284
    have ind: "\<forall>i\<in>Basis. i \<in> d \<longrightarrow> u i = ?x \<bullet> i"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1285
      and notind: "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> ?x \<bullet> i = 0)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1286
      using substdbasis_expansion_unique[OF assms] by blast+
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1287
    then have **: "sum u ?D = sum ((\<bullet>) ?x) ?D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1288
      using assms by (auto intro!: sum.cong)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1289
    show "0 \<le> ?x \<bullet> i" if "i \<in> Basis" for i
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1290
      using as(1) ind notind that by fastforce
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1291
    show "sum ((\<bullet>) ?x) ?D \<le> 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1292
      using "**" as(2) by linarith
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1293
    show "?x \<bullet> i = 0" if "i \<in> Basis" "i \<notin> d" for i
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1294
      using notind that by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1295
  next
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1296
    fix x 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1297
    assume "\<forall>i\<in>Basis. 0 \<le> x \<bullet> i" "sum ((\<bullet>) x) ?D \<le> 1" "(\<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = 0)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1298
    with d show "\<exists>u. (\<forall>x\<in>?D. 0 \<le> u x) \<and> sum u ?D \<le> 1 \<and> (\<Sum>x\<in>?D. u x *\<^sub>R x) = x"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1299
      unfolding substdbasis_expansion_unique[OF assms] 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1300
      by (rule_tac x="inner x" in exI) auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1301
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1302
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1303
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1304
lemma std_simplex:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1305
  "convex hull (insert 0 Basis) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1306
    {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 \<le> x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis \<le> 1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1307
  using substd_simplex[of Basis] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1308
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1309
lemma interior_std_simplex:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1310
  "interior (convex hull (insert 0 Basis)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1311
    {x::'a::euclidean_space. (\<forall>i\<in>Basis. 0 < x\<bullet>i) \<and> sum (\<lambda>i. x\<bullet>i) Basis < 1}"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1312
  unfolding set_eq_iff mem_interior std_simplex
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1313
proof (intro allI iffI CollectI; clarify)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1314
  fix x :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1315
  fix e
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1316
  assume "e > 0" and as: "ball x e \<subseteq> {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1317
  show "(\<forall>i\<in>Basis. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) Basis < 1"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1318
  proof safe
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1319
    fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1320
    assume i: "i \<in> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1321
    then show "0 < x \<bullet> i"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1322
      using as[THEN subsetD[where c="x - (e / 2) *\<^sub>R i"]] and \<open>e > 0\<close> 
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1323
      by (force simp add: inner_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1324
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1325
    have **: "dist x (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis)) < e" using \<open>e > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1326
      unfolding dist_norm
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1327
      by (auto intro!: mult_strict_left_mono simp: SOME_Basis)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1328
    have "\<And>i. i \<in> Basis \<Longrightarrow> (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis)) \<bullet> i =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1329
      x\<bullet>i + (if i = (SOME i. i\<in>Basis) then e/2 else 0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1330
      by (auto simp: SOME_Basis inner_Basis inner_simps)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1331
    then have *: "sum ((\<bullet>) (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis))) Basis =
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1332
      sum (\<lambda>i. x\<bullet>i + (if (SOME i. i\<in>Basis) = i then e/2 else 0)) Basis"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1333
      by (auto simp: intro!: sum.cong)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1334
    have "sum ((\<bullet>) x) Basis < sum ((\<bullet>) (x + (e / 2) *\<^sub>R (SOME i. i\<in>Basis))) Basis"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1335
      using \<open>e > 0\<close> DIM_positive by (auto simp: SOME_Basis sum.distrib *)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1336
    also have "\<dots> \<le> 1"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1337
      using ** as by force
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1338
    finally show "sum ((\<bullet>) x) Basis < 1" by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1339
  qed 
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1340
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1341
  fix x :: 'a
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1342
  assume as: "\<forall>i\<in>Basis. 0 < x \<bullet> i" "sum ((\<bullet>) x) Basis < 1"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1343
  obtain a :: 'b where "a \<in> UNIV" using UNIV_witness ..
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1344
  let ?d = "(1 - sum ((\<bullet>) x) Basis) / real (DIM('a))"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1345
  show "\<exists>e>0. ball x e \<subseteq> {x. (\<forall>i\<in>Basis. 0 \<le> x \<bullet> i) \<and> sum ((\<bullet>) x) Basis \<le> 1}"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1346
  proof (rule_tac x="min (Min (((\<bullet>) x) ` Basis)) D" for D in exI, intro conjI subsetI CollectI)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1347
    fix y
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1348
    assume y: "y \<in> ball x (min (Min ((\<bullet>) x ` Basis)) ?d)"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1349
    have "sum ((\<bullet>) y) Basis \<le> sum (\<lambda>i. x\<bullet>i + ?d) Basis"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1350
    proof (rule sum_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1351
      fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1352
      assume i: "i \<in> Basis"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1353
      have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1354
        by (metis Basis_le_norm i inner_commute inner_diff_right)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1355
      also have "... < ?d"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1356
        using y by (simp add: dist_norm norm_minus_commute)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1357
      finally have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < ?d" .
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1358
      then show "y \<bullet> i \<le> x \<bullet> i + ?d" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1359
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1360
    also have "\<dots> \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1361
      unfolding sum.distrib sum_constant
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1362
      by (auto simp add: Suc_le_eq)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1363
    finally show "sum ((\<bullet>) y) Basis \<le> 1" .
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1364
    show "(\<forall>i\<in>Basis. 0 \<le> y \<bullet> i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1365
    proof safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1366
      fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1367
      assume i: "i \<in> Basis"
68796
9ca183045102 simplified syntax setup for big operators under image, retaining input abbreviations for backward compatibility
haftmann
parents: 68607
diff changeset
  1368
      have "norm (x - y) < Min (((\<bullet>) x) ` Basis)"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1369
        using y by (auto simp: dist_norm less_eq_real_def)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1370
      also have "... \<le> x\<bullet>i"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1371
        using i by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1372
      finally have "norm (x - y) < x\<bullet>i" .
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1373
      then show "0 \<le> y\<bullet>i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1374
        using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format, OF i]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1375
        by (auto simp: inner_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1376
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1377
  next
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1378
    have "Min (((\<bullet>) x) ` Basis) > 0"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1379
      using as by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1380
    moreover have "?d > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1381
      using as by (auto simp: Suc_le_eq)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1382
    ultimately show "0 < min (Min ((\<bullet>) x ` Basis)) ((1 - sum ((\<bullet>) x) Basis) / real DIM('a))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1383
      by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1384
  qed 
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1385
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1386
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1387
lemma interior_std_simplex_nonempty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1388
  obtains a :: "'a::euclidean_space" where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1389
    "a \<in> interior(convex hull (insert 0 Basis))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1390
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1391
  let ?D = "Basis :: 'a set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1392
  let ?a = "sum (\<lambda>b::'a. inverse (2 * real DIM('a)) *\<^sub>R b) Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1393
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1394
    fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1395
    assume i: "i \<in> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1396
    have "?a \<bullet> i = inverse (2 * real DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1397
      by (rule trans[of _ "sum (\<lambda>j. if i = j then inverse (2 * real DIM('a)) else 0) ?D"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1398
         (simp_all add: sum.If_cases i) }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1399
  note ** = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1400
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1401
    apply (rule that[of ?a])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1402
    unfolding interior_std_simplex mem_Collect_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1403
  proof safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1404
    fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1405
    assume i: "i \<in> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1406
    show "0 < ?a \<bullet> i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1407
      unfolding **[OF i] by (auto simp add: Suc_le_eq DIM_positive)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1408
  next
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1409
    have "sum ((\<bullet>) ?a) ?D = sum (\<lambda>i. inverse (2 * real DIM('a))) ?D"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1410
      apply (rule sum.cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1411
      apply rule
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1412
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1413
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1414
    also have "\<dots> < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1415
      unfolding sum_constant divide_inverse[symmetric]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1416
      by (auto simp add: field_simps)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1417
    finally show "sum ((\<bullet>) ?a) ?D < 1" by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1418
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1419
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1420
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1421
lemma rel_interior_substd_simplex:
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1422
  assumes D: "D \<subseteq> Basis"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1423
  shows "rel_interior (convex hull (insert 0 D)) =
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1424
    {x::'a::euclidean_space. (\<forall>i\<in>D. 0 < x\<bullet>i) \<and> (\<Sum>i\<in>D. x\<bullet>i) < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1425
  (is "rel_interior (convex hull (insert 0 ?p)) = ?s")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1426
proof -
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1427
  have "finite D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1428
    using D finite_Basis finite_subset by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1429
  show ?thesis
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1430
  proof (cases "D = {}")
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1431
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1432
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1433
      using rel_interior_sing using euclidean_eq_iff[of _ 0] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1434
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1435
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1436
    have h0: "affine hull (convex hull (insert 0 ?p)) =
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1437
      {x::'a::euclidean_space. (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1438
      using affine_hull_convex_hull affine_hull_substd_basis assms by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1439
    have aux: "\<And>x::'a. \<forall>i\<in>Basis. (\<forall>i\<in>D. 0 \<le> x\<bullet>i) \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0) \<longrightarrow> 0 \<le> x\<bullet>i"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1440
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1441
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1442
      fix x :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1443
      assume x: "x \<in> rel_interior (convex hull (insert 0 ?p))"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1444
      then obtain e where "e > 0" and
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1445
        "ball x e \<inter> {xa. (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> xa\<bullet>i = 0)} \<subseteq> convex hull (insert 0 ?p)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1446
        using mem_rel_interior_ball[of x "convex hull (insert 0 ?p)"] h0 by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1447
      then have as [rule_format]: "\<And>y. dist x y < e \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> y\<bullet>i = 0) \<longrightarrow>
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1448
        (\<forall>i\<in>D. 0 \<le> y \<bullet> i) \<and> sum ((\<bullet>) y) D \<le> 1"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1449
        unfolding ball_def unfolding substd_simplex[OF assms] using assms by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1450
      have x0: "(\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1451
        using x rel_interior_subset  substd_simplex[OF assms] by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1452
      have "(\<forall>i\<in>D. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) D < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x\<bullet>i = 0)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1453
      proof (intro conjI ballI)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1454
        fix i :: 'a
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1455
        assume "i \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1456
        then have "\<forall>j\<in>D. 0 \<le> (x - (e / 2) *\<^sub>R i) \<bullet> j"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1457
          apply -
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1458
          apply (rule as[THEN conjunct1])
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1459
          using D \<open>e > 0\<close> x0
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1460
          apply (auto simp: dist_norm inner_simps inner_Basis)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1461
          done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1462
        then show "0 < x \<bullet> i"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1463
          using \<open>e > 0\<close> \<open>i \<in> D\<close> D  by (force simp: inner_simps inner_Basis)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1464
      next
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1465
        obtain a where a: "a \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1466
          using \<open>D \<noteq> {}\<close> by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1467
        then have **: "dist x (x + (e / 2) *\<^sub>R a) < e"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1468
          using \<open>e > 0\<close> norm_Basis[of a] D
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1469
          unfolding dist_norm
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1470
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1471
        have "\<And>i. i \<in> Basis \<Longrightarrow> (x + (e / 2) *\<^sub>R a) \<bullet> i = x\<bullet>i + (if i = a then e/2 else 0)"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1472
          using a D by (auto simp: inner_simps inner_Basis)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1473
        then have *: "sum ((\<bullet>) (x + (e / 2) *\<^sub>R a)) D =
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1474
          sum (\<lambda>i. x\<bullet>i + (if a = i then e/2 else 0)) D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1475
          using D by (intro sum.cong) auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1476
        have "a \<in> Basis"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1477
          using \<open>a \<in> D\<close> D by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1478
        then have h1: "(\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> (x + (e / 2) *\<^sub>R a) \<bullet> i = 0)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1479
          using x0 D \<open>a\<in>D\<close> by (auto simp add: inner_add_left inner_Basis)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1480
        have "sum ((\<bullet>) x) D < sum ((\<bullet>) (x + (e / 2) *\<^sub>R a)) D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1481
          using \<open>e > 0\<close> \<open>a \<in> D\<close> \<open>finite D\<close> by (auto simp add: * sum.distrib)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1482
        also have "\<dots> \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1483
          using ** h1 as[rule_format, of "x + (e / 2) *\<^sub>R a"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1484
          by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1485
        finally show "sum ((\<bullet>) x) D < 1" "\<And>i. i\<in>Basis \<Longrightarrow> i \<notin> D \<longrightarrow> x\<bullet>i = 0"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1486
          using x0 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1487
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1488
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1489
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1490
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1491
      fix x :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1492
      assume as: "x \<in> ?s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1493
      have "\<forall>i. 0 < x\<bullet>i \<or> 0 = x\<bullet>i \<longrightarrow> 0 \<le> x\<bullet>i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1494
        by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1495
      moreover have "\<forall>i. i \<in> D \<or> i \<notin> D" by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1496
      ultimately
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1497
      have "\<forall>i. (\<forall>i\<in>D. 0 < x\<bullet>i) \<and> (\<forall>i. i \<notin> D \<longrightarrow> x\<bullet>i = 0) \<longrightarrow> 0 \<le> x\<bullet>i"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1498
        by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1499
      then have h2: "x \<in> convex hull (insert 0 ?p)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1500
        using as assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1501
        unfolding substd_simplex[OF assms] by fastforce
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1502
      obtain a where a: "a \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1503
        using \<open>D \<noteq> {}\<close> by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1504
      let ?d = "(1 - sum ((\<bullet>) x) D) / real (card D)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1505
      have "0 < card D" using \<open>D \<noteq> {}\<close> \<open>finite D\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1506
        by (simp add: card_gt_0_iff)
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1507
      have "Min (((\<bullet>) x) ` D) > 0"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1508
        using as \<open>D \<noteq> {}\<close> \<open>finite D\<close> by (simp add: Min_gr_iff)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1509
      moreover have "?d > 0" using as using \<open>0 < card D\<close> by auto
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1510
      ultimately have h3: "min (Min (((\<bullet>) x) ` D)) ?d > 0"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1511
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1512
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1513
      have "x \<in> rel_interior (convex hull (insert 0 ?p))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1514
        unfolding rel_interior_ball mem_Collect_eq h0
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1515
        apply (rule,rule h2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1516
        unfolding substd_simplex[OF assms]
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1517
        apply (rule_tac x="min (Min (((\<bullet>) x) ` D)) ?d" in exI)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1518
        apply (rule, rule h3)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1519
        apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1520
        unfolding mem_ball
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1521
      proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1522
        fix y :: 'a
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1523
        assume y: "dist x y < min (Min ((\<bullet>) x ` D)) ?d"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1524
        assume y2: "\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> y\<bullet>i = 0"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1525
        have "sum ((\<bullet>) y) D \<le> sum (\<lambda>i. x\<bullet>i + ?d) D"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1526
        proof (rule sum_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1527
          fix i
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1528
          assume "i \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1529
          with D have i: "i \<in> Basis"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1530
            by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1531
          have "\<bar>y\<bullet>i - x\<bullet>i\<bar> \<le> norm (y - x)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1532
            by (metis i inner_commute inner_diff_right norm_bound_Basis_le order_refl)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1533
          also have "... < ?d"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1534
            by (metis dist_norm min_less_iff_conj norm_minus_commute y)
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1535
          finally have "\<bar>y\<bullet>i - x\<bullet>i\<bar> < ?d" .
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1536
          then show "y \<bullet> i \<le> x \<bullet> i + ?d" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1537
        qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1538
        also have "\<dots> \<le> 1"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1539
          unfolding sum.distrib sum_constant  using \<open>0 < card D\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1540
          by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1541
        finally show "sum ((\<bullet>) y) D \<le> 1" .
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1542
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1543
        fix i :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1544
        assume i: "i \<in> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1545
        then show "0 \<le> y\<bullet>i"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1546
        proof (cases "i\<in>D")
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1547
          case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1548
          have "norm (x - y) < x\<bullet>i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1549
            using y[unfolded min_less_iff_conj dist_norm, THEN conjunct1]
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1550
            using Min_gr_iff[of "(\<bullet>) x ` D" "norm (x - y)"] \<open>0 < card D\<close> \<open>i \<in> D\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1551
            by (simp add: card_gt_0_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1552
          then show "0 \<le> y\<bullet>i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1553
            using Basis_le_norm[OF i, of "x - y"] and as(1)[rule_format]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1554
            by (auto simp: inner_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1555
        qed (insert y2, auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1556
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1557
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1558
    ultimately have
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1559
      "\<And>x. x \<in> rel_interior (convex hull insert 0 D) \<longleftrightarrow>
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1560
        x \<in> {x. (\<forall>i\<in>D. 0 < x \<bullet> i) \<and> sum ((\<bullet>) x) D < 1 \<and> (\<forall>i\<in>Basis. i \<notin> D \<longrightarrow> x \<bullet> i = 0)}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1561
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1562
    then show ?thesis by (rule set_eqI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1563
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1564
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1565
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1566
lemma rel_interior_substd_simplex_nonempty:
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1567
  assumes "D \<noteq> {}"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1568
    and "D \<subseteq> Basis"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1569
  obtains a :: "'a::euclidean_space"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1570
    where "a \<in> rel_interior (convex hull (insert 0 D))"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1571
proof -
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1572
  let ?D = D
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1573
  let ?a = "sum (\<lambda>b::'a::euclidean_space. inverse (2 * real (card D)) *\<^sub>R b) ?D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1574
  have "finite D"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1575
    apply (rule finite_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1576
    using assms(2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1577
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1578
    done
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1579
  then have d1: "0 < real (card D)"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1580
    using \<open>D \<noteq> {}\<close> by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1581
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1582
    fix i
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1583
    assume "i \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1584
    have "?a \<bullet> i = inverse (2 * real (card D))"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1585
      apply (rule trans[of _ "sum (\<lambda>j. if i = j then inverse (2 * real (card D)) else 0) ?D"])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1586
      unfolding inner_sum_left
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1587
      apply (rule sum.cong)
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1588
      using \<open>i \<in> D\<close> \<open>finite D\<close> sum.delta'[of D i "(\<lambda>k. inverse (2 * real (card D)))"]
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1589
        d1 assms(2)
69712
dc85b5b3a532 renamings and new material
paulson <lp15@cam.ac.uk>
parents: 69676
diff changeset
  1590
      by (auto simp: inner_Basis rev_subsetD[OF _ assms(2)])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1591
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1592
  note ** = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1593
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1594
    apply (rule that[of ?a])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1595
    unfolding rel_interior_substd_simplex[OF assms(2)] mem_Collect_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1596
  proof safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1597
    fix i
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1598
    assume "i \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1599
    have "0 < inverse (2 * real (card D))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1600
      using d1 by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1601
    also have "\<dots> = ?a \<bullet> i" using **[of i] \<open>i \<in> D\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1602
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1603
    finally show "0 < ?a \<bullet> i" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1604
  next
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1605
    have "sum ((\<bullet>) ?a) ?D = sum (\<lambda>i. inverse (2 * real (card D))) ?D"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1606
      by (rule sum.cong) (rule refl, rule **)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1607
    also have "\<dots> < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1608
      unfolding sum_constant divide_real_def[symmetric]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1609
      by (auto simp add: field_simps)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1610
    finally show "sum ((\<bullet>) ?a) ?D < 1" by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1611
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1612
    fix i
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1613
    assume "i \<in> Basis" and "i \<notin> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1614
    have "?a \<in> span D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1615
    proof (rule span_sum[of D "(\<lambda>b. b /\<^sub>R (2 * real (card D)))" D])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1616
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1617
        fix x :: "'a::euclidean_space"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1618
        assume "x \<in> D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1619
        then have "x \<in> span D"
68074
8d50467f7555 fixed HOL-Analysis
immler
parents: 68073
diff changeset
  1620
          using span_base[of _ "D"] by auto
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1621
        then have "x /\<^sub>R (2 * real (card D)) \<in> span D"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1622
          using span_mul[of x "D" "(inverse (real (card D)) / 2)"] by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1623
      }
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1624
      then show "\<And>x. x\<in>D \<Longrightarrow> x /\<^sub>R (2 * real (card D)) \<in> span D"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1625
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1626
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1627
    then show "?a \<bullet> i = 0 "
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1628
      using \<open>i \<notin> D\<close> unfolding span_substd_basis[OF assms(2)] using \<open>i \<in> Basis\<close> by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1629
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1630
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1631
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1632
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  1633
subsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior of convex set\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1634
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1635
lemma rel_interior_convex_nonempty_aux:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1636
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1637
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1638
    and "0 \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1639
  shows "rel_interior S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1640
proof (cases "S = {0}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1641
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1642
  then show ?thesis using rel_interior_sing by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1643
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1644
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1645
  obtain B where B: "independent B \<and> B \<le> S \<and> S \<le> span B \<and> card B = dim S"
68069
36209dfb981e tidying up and using real induction methods
paulson <lp15@cam.ac.uk>
parents: 68056
diff changeset
  1646
    using basis_exists[of S] by metis
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1647
  then have "B \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1648
    using B assms \<open>S \<noteq> {0}\<close> span_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1649
  have "insert 0 B \<le> span B"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1650
    using subspace_span[of B] subspace_0[of "span B"]
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1651
      span_superset by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1652
  then have "span (insert 0 B) \<le> span B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1653
    using span_span[of B] span_mono[of "insert 0 B" "span B"] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1654
  then have "convex hull insert 0 B \<le> span B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1655
    using convex_hull_subset_span[of "insert 0 B"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1656
  then have "span (convex hull insert 0 B) \<le> span B"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1657
    using span_span[of B]
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1658
      span_mono[of "convex hull insert 0 B" "span B"] by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1659
  then have *: "span (convex hull insert 0 B) = span B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1660
    using span_mono[of B "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1661
  then have "span (convex hull insert 0 B) = span S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1662
    using B span_mono[of B S] span_mono[of S "span B"]
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1663
      span_span[of B] by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1664
  moreover have "0 \<in> affine hull (convex hull insert 0 B)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1665
    using hull_subset[of "convex hull insert 0 B"] hull_subset[of "insert 0 B"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1666
  ultimately have **: "affine hull (convex hull insert 0 B) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1667
    using affine_hull_span_0[of "convex hull insert 0 B"] affine_hull_span_0[of "S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1668
      assms hull_subset[of S]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1669
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1670
  obtain d and f :: "'n \<Rightarrow> 'n" where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1671
    fd: "card d = card B" "linear f" "f ` B = d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1672
      "f ` span B = {x. \<forall>i\<in>Basis. i \<notin> d \<longrightarrow> x \<bullet> i = (0::real)} \<and> inj_on f (span B)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1673
    and d: "d \<subseteq> Basis"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1674
    using basis_to_substdbasis_subspace_isomorphism[of B,OF _ ] B by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1675
  then have "bounded_linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1676
    using linear_conv_bounded_linear by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1677
  have "d \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1678
    using fd B \<open>B \<noteq> {}\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1679
  have "insert 0 d = f ` (insert 0 B)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1680
    using fd linear_0 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1681
  then have "(convex hull (insert 0 d)) = f ` (convex hull (insert 0 B))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1682
    using convex_hull_linear_image[of f "(insert 0 d)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1683
      convex_hull_linear_image[of f "(insert 0 B)"] \<open>linear f\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1684
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1685
  moreover have "rel_interior (f ` (convex hull insert 0 B)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1686
    f ` rel_interior (convex hull insert 0 B)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1687
    apply (rule  rel_interior_injective_on_span_linear_image[of f "(convex hull insert 0 B)"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1688
    using \<open>bounded_linear f\<close> fd *
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1689
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1690
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1691
  ultimately have "rel_interior (convex hull insert 0 B) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1692
    using rel_interior_substd_simplex_nonempty[OF \<open>d \<noteq> {}\<close> d]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1693
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1694
    apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1695
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1696
  moreover have "convex hull (insert 0 B) \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1697
    using B assms hull_mono[of "insert 0 B" "S" "convex"] convex_hull_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1698
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1699
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1700
    using subset_rel_interior[of "convex hull insert 0 B" S] ** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1701
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1702
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1703
lemma rel_interior_eq_empty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1704
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1705
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1706
  shows "rel_interior S = {} \<longleftrightarrow> S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1707
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1708
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1709
    assume "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1710
    then obtain a where "a \<in> S" by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1711
    then have "0 \<in> (+) (-a) ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1712
      using assms exI[of "(\<lambda>x. x \<in> S \<and> - a + x = 0)" a] by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1713
    then have "rel_interior ((+) (-a) ` S) \<noteq> {}"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  1714
      using rel_interior_convex_nonempty_aux[of "(+) (-a) ` S"]
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1715
        convex_translation[of S "-a"] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1716
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1717
    then have "rel_interior S \<noteq> {}"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  1718
      using rel_interior_translation [of "- a"] by simp
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1719
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1720
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1721
    using rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1722
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1723
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1724
lemma interior_simplex_nonempty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1725
  fixes S :: "'N :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1726
  assumes "independent S" "finite S" "card S = DIM('N)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1727
  obtains a where "a \<in> interior (convex hull (insert 0 S))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1728
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1729
  have "affine hull (insert 0 S) = UNIV"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1730
    by (simp add: hull_inc affine_hull_span_0 dim_eq_full[symmetric]
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  1731
         assms(1) assms(3) dim_eq_card_independent)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1732
  moreover have "rel_interior (convex hull insert 0 S) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1733
    using rel_interior_eq_empty [of "convex hull (insert 0 S)"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1734
  ultimately have "interior (convex hull insert 0 S) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1735
    by (simp add: rel_interior_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1736
  with that show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1737
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1738
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1739
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1740
lemma convex_rel_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1741
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1742
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1743
  shows "convex (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1744
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1745
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1746
    fix x y and u :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1747
    assume assm: "x \<in> rel_interior S" "y \<in> rel_interior S" "0 \<le> u" "u \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1748
    then have "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1749
      using rel_interior_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1750
    have "x - u *\<^sub>R (x-y) \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1751
    proof (cases "0 = u")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1752
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1753
      then have "0 < u" using assm by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1754
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1755
        using assm rel_interior_convex_shrink[of S y x u] assms \<open>x \<in> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1756
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1757
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1758
      then show ?thesis using assm by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1759
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1760
    then have "(1 - u) *\<^sub>R x + u *\<^sub>R y \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1761
      by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1762
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1763
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1764
    unfolding convex_alt by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1765
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1766
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1767
lemma convex_closure_rel_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1768
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1769
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1770
  shows "closure (rel_interior S) = closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1771
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1772
  have h1: "closure (rel_interior S) \<le> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1773
    using closure_mono[of "rel_interior S" S] rel_interior_subset[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1774
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1775
  proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1776
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1777
    then obtain a where a: "a \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1778
      using rel_interior_eq_empty assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1779
    { fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1780
      assume x: "x \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1781
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1782
        assume "x = a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1783
        then have "x \<in> closure (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1784
          using a unfolding closure_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1785
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1786
      moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1787
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1788
        assume "x \<noteq> a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1789
         {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1790
           fix e :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1791
           assume "e > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1792
           define e1 where "e1 = min 1 (e/norm (x - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1793
           then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (x - a) \<le> e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1794
             using \<open>x \<noteq> a\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (x - a)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1795
             by simp_all
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  1796
           then have *: "x - e1 *\<^sub>R (x - a) \<in> rel_interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1797
             using rel_interior_closure_convex_shrink[of S a x e1] assms x a e1_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1798
             by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1799
           have "\<exists>y. y \<in> rel_interior S \<and> y \<noteq> x \<and> dist y x \<le> e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1800
              apply (rule_tac x="x - e1 *\<^sub>R (x - a)" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1801
              using * e1 dist_norm[of "x - e1 *\<^sub>R (x - a)" x] \<open>x \<noteq> a\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1802
              apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1803
              done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1804
        }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1805
        then have "x islimpt rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1806
          unfolding islimpt_approachable_le by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1807
        then have "x \<in> closure(rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1808
          unfolding closure_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1809
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1810
      ultimately have "x \<in> closure(rel_interior S)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1811
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1812
    then show ?thesis using h1 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1813
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1814
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1815
    then have "rel_interior S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1816
      using rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1817
    then have "closure (rel_interior S) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1818
      using closure_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1819
    with True show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1820
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1821
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1822
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1823
lemma rel_interior_same_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1824
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1825
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1826
  shows "affine hull (rel_interior S) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1827
  by (metis assms closure_same_affine_hull convex_closure_rel_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1828
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1829
lemma rel_interior_aff_dim:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1830
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1831
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1832
  shows "aff_dim (rel_interior S) = aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1833
  by (metis aff_dim_affine_hull2 assms rel_interior_same_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1834
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1835
lemma rel_interior_rel_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1836
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1837
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1838
  shows "rel_interior (rel_interior S) = rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1839
proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  1840
  have "openin (top_of_set (affine hull (rel_interior S))) (rel_interior S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1841
    using openin_rel_interior[of S] rel_interior_same_affine_hull[of S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1842
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1843
    using rel_interior_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1844
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1845
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1846
lemma rel_interior_rel_open:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1847
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1848
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1849
  shows "rel_open (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1850
  unfolding rel_open_def using rel_interior_rel_interior assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1851
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1852
lemma convex_rel_interior_closure_aux:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1853
  fixes x y z :: "'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1854
  assumes "0 < a" "0 < b" "(a + b) *\<^sub>R z = a *\<^sub>R x + b *\<^sub>R y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1855
  obtains e where "0 < e" "e \<le> 1" "z = y - e *\<^sub>R (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1856
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1857
  define e where "e = a / (a + b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1858
  have "z = (1 / (a + b)) *\<^sub>R ((a + b) *\<^sub>R z)"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  1859
    using assms  by (simp add: eq_vector_fraction_iff)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1860
  also have "\<dots> = (1 / (a + b)) *\<^sub>R (a *\<^sub>R x + b *\<^sub>R y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1861
    using assms scaleR_cancel_left[of "1/(a+b)" "(a + b) *\<^sub>R z" "a *\<^sub>R x + b *\<^sub>R y"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1862
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1863
  also have "\<dots> = y - e *\<^sub>R (y-x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1864
    using e_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1865
    apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1866
    using scaleR_left_distrib[of "a/(a+b)" "b/(a+b)" y] assms add_divide_distrib[of a b "a+b"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1867
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1868
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1869
  finally have "z = y - e *\<^sub>R (y-x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1870
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1871
  moreover have "e > 0" using e_def assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1872
  moreover have "e \<le> 1" using e_def assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1873
  ultimately show ?thesis using that[of e] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1874
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1875
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1876
lemma convex_rel_interior_closure:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1877
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1878
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1879
  shows "rel_interior (closure S) = rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1880
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1881
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1882
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1883
    using assms rel_interior_eq_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1884
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1885
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1886
  have "rel_interior (closure S) \<supseteq> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1887
    using subset_rel_interior[of S "closure S"] closure_same_affine_hull closure_subset
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1888
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1889
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1890
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1891
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1892
    assume z: "z \<in> rel_interior (closure S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1893
    obtain x where x: "x \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1894
      using \<open>S \<noteq> {}\<close> assms rel_interior_eq_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1895
    have "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1896
    proof (cases "x = z")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1897
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1898
      then show ?thesis using x by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1899
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1900
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1901
      obtain e where e: "e > 0" "cball z e \<inter> affine hull closure S \<le> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1902
        using z rel_interior_cball[of "closure S"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1903
      hence *: "0 < e/norm(z-x)" using e False by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1904
      define y where "y = z + (e/norm(z-x)) *\<^sub>R (z-x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1905
      have yball: "y \<in> cball z e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1906
        using mem_cball y_def dist_norm[of z y] e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1907
      have "x \<in> affine hull closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1908
        using x rel_interior_subset_closure hull_inc[of x "closure S"] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1909
      moreover have "z \<in> affine hull closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1910
        using z rel_interior_subset hull_subset[of "closure S"] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1911
      ultimately have "y \<in> affine hull closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1912
        using y_def affine_affine_hull[of "closure S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1913
          mem_affine_3_minus [of "affine hull closure S" z z x "e/norm(z-x)"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1914
      then have "y \<in> closure S" using e yball by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1915
      have "(1 + (e/norm(z-x))) *\<^sub>R z = (e/norm(z-x)) *\<^sub>R x + y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1916
        using y_def by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1917
      then obtain e1 where "0 < e1" "e1 \<le> 1" "z = y - e1 *\<^sub>R (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1918
        using * convex_rel_interior_closure_aux[of "e / norm (z - x)" 1 z x y]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1919
        by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1920
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1921
        using rel_interior_closure_convex_shrink assms x \<open>y \<in> closure S\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1922
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1923
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1924
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1925
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1926
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1927
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1928
lemma convex_interior_closure:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1929
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1930
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1931
  shows "interior (closure S) = interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1932
  using closure_aff_dim[of S] interior_rel_interior_gen[of S]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1933
    interior_rel_interior_gen[of "closure S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1934
    convex_rel_interior_closure[of S] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1935
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1936
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1937
lemma closure_eq_rel_interior_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1938
  fixes S1 S2 :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1939
  assumes "convex S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1940
    and "convex S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1941
  shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 = rel_interior S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1942
  by (metis convex_rel_interior_closure convex_closure_rel_interior assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1943
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1944
lemma closure_eq_between:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1945
  fixes S1 S2 :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1946
  assumes "convex S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1947
    and "convex S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1948
  shows "closure S1 = closure S2 \<longleftrightarrow> rel_interior S1 \<le> S2 \<and> S2 \<subseteq> closure S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1949
  (is "?A \<longleftrightarrow> ?B")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1950
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1951
  assume ?A
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1952
  then show ?B
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1953
    by (metis assms closure_subset convex_rel_interior_closure rel_interior_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1954
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1955
  assume ?B
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1956
  then have "closure S1 \<subseteq> closure S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1957
    by (metis assms(1) convex_closure_rel_interior closure_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1958
  moreover from \<open>?B\<close> have "closure S1 \<supseteq> closure S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1959
    by (metis closed_closure closure_minimal)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1960
  ultimately show ?A ..
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1961
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1962
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1963
lemma open_inter_closure_rel_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1964
  fixes S A :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1965
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1966
    and "open A"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1967
  shows "A \<inter> closure S = {} \<longleftrightarrow> A \<inter> rel_interior S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1968
  by (metis assms convex_closure_rel_interior open_Int_closure_eq_empty)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1969
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1970
lemma rel_interior_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1971
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1972
  shows "rel_interior(open_segment a b) = open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1973
proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1974
  case True then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1975
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1976
  case False then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1977
    apply (simp add: rel_interior_eq openin_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1978
    apply (rule_tac x="ball (inverse 2 *\<^sub>R (a + b)) (norm(b - a) / 2)" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1979
    apply (simp add: open_segment_as_ball)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1980
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1981
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1982
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1983
lemma rel_interior_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1984
  fixes a :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1985
  shows "rel_interior(closed_segment a b) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1986
         (if a = b then {a} else open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1987
proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1988
  case True then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1989
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1990
  case False then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1991
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1992
       (metis closure_open_segment convex_open_segment convex_rel_interior_closure
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1993
              rel_interior_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1994
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1995
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1996
lemmas rel_interior_segment = rel_interior_closed_segment rel_interior_open_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1997
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1998
lemma starlike_convex_tweak_boundary_points:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1999
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2000
  assumes "convex S" "S \<noteq> {}" and ST: "rel_interior S \<subseteq> T" and TS: "T \<subseteq> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2001
  shows "starlike T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2002
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2003
  have "rel_interior S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2004
    by (simp add: assms rel_interior_eq_empty)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2005
  then obtain a where a: "a \<in> rel_interior S"  by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2006
  with ST have "a \<in> T"  by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2007
  have *: "\<And>x. x \<in> T \<Longrightarrow> open_segment a x \<subseteq> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2008
    apply (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> a])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2009
    using assms by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2010
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2011
    unfolding starlike_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2012
    apply (rule bexI [OF _ \<open>a \<in> T\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2013
    apply (simp add: closed_segment_eq_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2014
    apply (intro conjI ballI a \<open>a \<in> T\<close> rel_interior_closure_convex_segment [OF \<open>convex S\<close> a])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2015
    apply (simp add: order_trans [OF * ST])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2016
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2017
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2018
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2019
subsection\<open>The relative frontier of a set\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2020
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  2021
definition\<^marker>\<open>tag important\<close> "rel_frontier S = closure S - rel_interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2022
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2023
lemma rel_frontier_empty [simp]: "rel_frontier {} = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2024
  by (simp add: rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2025
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2026
lemma rel_frontier_eq_empty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2027
    fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2028
    shows "rel_frontier S = {} \<longleftrightarrow> affine S"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2029
  unfolding rel_frontier_def
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2030
  using rel_interior_subset_closure  by (auto simp add: rel_interior_eq_closure [symmetric])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2031
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2032
lemma rel_frontier_sing [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2033
    fixes a :: "'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2034
    shows "rel_frontier {a} = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2035
  by (simp add: rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2036
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2037
lemma rel_frontier_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2038
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2039
  shows "rel_frontier S \<subseteq> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2040
using closure_affine_hull rel_frontier_def by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2041
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2042
lemma rel_frontier_cball [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2043
    fixes a :: "'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2044
    shows "rel_frontier(cball a r) = (if r = 0 then {} else sphere a r)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2045
proof (cases rule: linorder_cases [of r 0])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2046
  case less then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2047
    by (force simp: sphere_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2048
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2049
  case equal then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2050
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2051
  case greater then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2052
    apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2053
    by (metis centre_in_ball empty_iff frontier_cball frontier_def interior_cball interior_rel_interior_gen rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2054
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2055
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2056
lemma rel_frontier_translation:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2057
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2058
  shows "rel_frontier((\<lambda>x. a + x) ` S) = (\<lambda>x. a + x) ` (rel_frontier S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2059
by (simp add: rel_frontier_def translation_diff rel_interior_translation closure_translation)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2060
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2061
lemma closed_affine_hull [iff]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2062
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2063
  shows "closed (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2064
  by (metis affine_affine_hull affine_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2065
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2066
lemma rel_frontier_nonempty_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2067
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2068
  shows "interior S \<noteq> {} \<Longrightarrow> rel_frontier S = frontier S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2069
by (metis frontier_def interior_rel_interior_gen rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2070
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2071
lemma rel_frontier_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2072
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2073
  shows "affine hull S = UNIV \<Longrightarrow> rel_frontier S = frontier S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2074
by (simp add: frontier_def rel_frontier_def rel_interior_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2075
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2076
lemma closest_point_in_rel_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2077
   "\<lbrakk>closed S; S \<noteq> {}; x \<in> affine hull S - rel_interior S\<rbrakk>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2078
   \<Longrightarrow> closest_point S x \<in> rel_frontier S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2079
  by (simp add: closest_point_in_rel_interior closest_point_in_set rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2080
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2081
lemma closed_rel_frontier [iff]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2082
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2083
  shows "closed (rel_frontier S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2084
proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  2085
  have *: "closedin (top_of_set (affine hull S)) (closure S - rel_interior S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2086
    by (simp add: closed_subset closedin_diff closure_affine_hull openin_rel_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2087
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2088
    apply (rule closedin_closed_trans[of "affine hull S" "rel_frontier S"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2089
    unfolding rel_frontier_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2090
    using * closed_affine_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2091
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2092
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2093
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2094
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2095
lemma closed_rel_boundary:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2096
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2097
  shows "closed S \<Longrightarrow> closed(S - rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2098
by (metis closed_rel_frontier closure_closed rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2099
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2100
lemma compact_rel_boundary:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2101
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2102
  shows "compact S \<Longrightarrow> compact(S - rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2103
by (metis bounded_diff closed_rel_boundary closure_eq compact_closure compact_imp_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2104
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2105
lemma bounded_rel_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2106
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2107
  shows "bounded S \<Longrightarrow> bounded(rel_frontier S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2108
by (simp add: bounded_closure bounded_diff rel_frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2109
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2110
lemma compact_rel_frontier_bounded:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2111
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2112
  shows "bounded S \<Longrightarrow> compact(rel_frontier S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2113
using bounded_rel_frontier closed_rel_frontier compact_eq_bounded_closed by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2114
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2115
lemma compact_rel_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2116
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2117
  shows "compact S \<Longrightarrow> compact(rel_frontier S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2118
by (meson compact_eq_bounded_closed compact_rel_frontier_bounded)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2119
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2120
lemma convex_same_rel_interior_closure:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2121
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2122
  shows "\<lbrakk>convex S; convex T\<rbrakk>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2123
         \<Longrightarrow> rel_interior S = rel_interior T \<longleftrightarrow> closure S = closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2124
by (simp add: closure_eq_rel_interior_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2125
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2126
lemma convex_same_rel_interior_closure_straddle:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2127
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2128
  shows "\<lbrakk>convex S; convex T\<rbrakk>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2129
         \<Longrightarrow> rel_interior S = rel_interior T \<longleftrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2130
             rel_interior S \<subseteq> T \<and> T \<subseteq> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2131
by (simp add: closure_eq_between convex_same_rel_interior_closure)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2132
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2133
lemma convex_rel_frontier_aff_dim:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2134
  fixes S1 S2 :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2135
  assumes "convex S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2136
    and "convex S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2137
    and "S2 \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2138
    and "S1 \<le> rel_frontier S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2139
  shows "aff_dim S1 < aff_dim S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2140
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2141
  have "S1 \<subseteq> closure S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2142
    using assms unfolding rel_frontier_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2143
  then have *: "affine hull S1 \<subseteq> affine hull S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2144
    using hull_mono[of "S1" "closure S2"] closure_same_affine_hull[of S2] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2145
  then have "aff_dim S1 \<le> aff_dim S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2146
    using * aff_dim_affine_hull[of S1] aff_dim_affine_hull[of S2]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2147
      aff_dim_subset[of "affine hull S1" "affine hull S2"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2148
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2149
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2150
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2151
    assume eq: "aff_dim S1 = aff_dim S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2152
    then have "S1 \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2153
      using aff_dim_empty[of S1] aff_dim_empty[of S2] \<open>S2 \<noteq> {}\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2154
    have **: "affine hull S1 = affine hull S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2155
       apply (rule affine_dim_equal)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2156
       using * affine_affine_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2157
       apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2158
       using \<open>S1 \<noteq> {}\<close> hull_subset[of S1]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2159
       apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2160
       using eq aff_dim_affine_hull[of S1] aff_dim_affine_hull[of S2]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2161
       apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2162
       done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2163
    obtain a where a: "a \<in> rel_interior S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2164
      using \<open>S1 \<noteq> {}\<close> rel_interior_eq_empty assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2165
    obtain T where T: "open T" "a \<in> T \<inter> S1" "T \<inter> affine hull S1 \<subseteq> S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2166
       using mem_rel_interior[of a S1] a by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2167
    then have "a \<in> T \<inter> closure S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2168
      using a assms unfolding rel_frontier_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2169
    then obtain b where b: "b \<in> T \<inter> rel_interior S2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2170
      using open_inter_closure_rel_interior[of S2 T] assms T by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2171
    then have "b \<in> affine hull S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2172
      using rel_interior_subset hull_subset[of S2] ** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2173
    then have "b \<in> S1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2174
      using T b by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2175
    then have False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2176
      using b assms unfolding rel_frontier_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2177
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2178
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2179
    using less_le by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2180
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2181
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2182
lemma convex_rel_interior_if:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2183
  fixes S ::  "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2184
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2185
    and "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2186
  shows "\<forall>x\<in>affine hull S. \<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2187
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2188
  obtain e1 where e1: "e1 > 0 \<and> cball z e1 \<inter> affine hull S \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2189
    using mem_rel_interior_cball[of z S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2190
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2191
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2192
    assume x: "x \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2193
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2194
      assume "x \<noteq> z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2195
      define m where "m = 1 + e1/norm(x-z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2196
      hence "m > 1" using e1 \<open>x \<noteq> z\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2197
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2198
        fix e
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2199
        assume e: "e > 1 \<and> e \<le> m"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2200
        have "z \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2201
          using assms rel_interior_subset hull_subset[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2202
        then have *: "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2203
          using mem_affine[of "affine hull S" x z "(1-e)" e] affine_affine_hull[of S] x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2204
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2205
        have "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) = norm ((e - 1) *\<^sub>R (x - z))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2206
          by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2207
        also have "\<dots> = (e - 1) * norm (x-z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2208
          using norm_scaleR e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2209
        also have "\<dots> \<le> (m - 1) * norm (x - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2210
          using e mult_right_mono[of _ _ "norm(x-z)"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2211
        also have "\<dots> = (e1 / norm (x - z)) * norm (x - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2212
          using m_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2213
        also have "\<dots> = e1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2214
          using \<open>x \<noteq> z\<close> e1 by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2215
        finally have **: "norm (z + e *\<^sub>R x - (x + e *\<^sub>R z)) \<le> e1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2216
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2217
        have "(1 - e)*\<^sub>R x+ e *\<^sub>R z \<in> cball z e1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2218
          using m_def **
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2219
          unfolding cball_def dist_norm
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2220
          by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2221
        then have "(1 - e) *\<^sub>R x+ e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2222
          using e * e1 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2223
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2224
      then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S )"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2225
        using \<open>m> 1 \<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2226
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2227
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2228
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2229
      assume "x = z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2230
      define m where "m = 1 + e1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2231
      then have "m > 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2232
        using e1 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2233
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2234
        fix e
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2235
        assume e: "e > 1 \<and> e \<le> m"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2236
        then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2237
          using e1 x \<open>x = z\<close> by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2238
        then have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2239
          using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2240
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2241
      then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2242
        using \<open>m > 1\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2243
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2244
    ultimately have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S )"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2245
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2246
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2247
  then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2248
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2249
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2250
lemma convex_rel_interior_if2:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2251
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2252
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2253
  assumes "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2254
  shows "\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2255
  using convex_rel_interior_if[of S z] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2256
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2257
lemma convex_rel_interior_only_if:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2258
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2259
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2260
    and "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2261
  assumes "\<forall>x\<in>S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2262
  shows "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2263
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2264
  obtain x where x: "x \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2265
    using rel_interior_eq_empty assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2266
  then have "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2267
    using rel_interior_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2268
  then obtain e where e: "e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2269
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2270
  define y where [abs_def]: "y = (1 - e) *\<^sub>R x + e *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2271
  then have "y \<in> S" using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2272
  define e1 where "e1 = 1/e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2273
  then have "0 < e1 \<and> e1 < 1" using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2274
  then have "z  =y - (1 - e1) *\<^sub>R (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2275
    using e1_def y_def by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2276
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2277
    using rel_interior_convex_shrink[of S x y "1-e1"] \<open>0 < e1 \<and> e1 < 1\<close> \<open>y \<in> S\<close> x assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2278
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2279
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2280
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2281
lemma convex_rel_interior_iff:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2282
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2283
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2284
    and "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2285
  shows "z \<in> rel_interior S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2286
  using assms hull_subset[of S "affine"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2287
    convex_rel_interior_if[of S z] convex_rel_interior_only_if[of S z]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2288
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2290
lemma convex_rel_interior_iff2:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2291
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2292
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2293
    and "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2294
  shows "z \<in> rel_interior S \<longleftrightarrow> (\<forall>x\<in>affine hull S. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2295
  using assms hull_subset[of S] convex_rel_interior_if2[of S z] convex_rel_interior_only_if[of S z]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2296
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2297
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2298
lemma convex_interior_iff:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2299
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2300
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2301
  shows "z \<in> interior S \<longleftrightarrow> (\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2302
proof (cases "aff_dim S = int DIM('n)")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2303
  case False
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2304
  { assume "z \<in> interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2305
    then have False
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2306
      using False interior_rel_interior_gen[of S] by auto }
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2307
  moreover
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2308
  { assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S"
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  2309
    { fix x
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2310
      obtain e1 where e1: "e1 > 0 \<and> z + e1 *\<^sub>R (x - z) \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2311
        using r by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2312
      obtain e2 where e2: "e2 > 0 \<and> z + e2 *\<^sub>R (z - x) \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2313
        using r by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2314
      define x1 where [abs_def]: "x1 = z + e1 *\<^sub>R (x - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2315
      then have x1: "x1 \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2316
        using e1 hull_subset[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2317
      define x2 where [abs_def]: "x2 = z + e2 *\<^sub>R (z - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2318
      then have x2: "x2 \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2319
        using e2 hull_subset[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2320
      have *: "e1/(e1+e2) + e2/(e1+e2) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2321
        using add_divide_distrib[of e1 e2 "e1+e2"] e1 e2 by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2322
      then have "z = (e2/(e1+e2)) *\<^sub>R x1 + (e1/(e1+e2)) *\<^sub>R x2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2323
        using x1_def x2_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2324
        apply (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2325
        using scaleR_left_distrib[of "e1/(e1+e2)" "e2/(e1+e2)" z]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2326
        apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2327
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2328
      then have z: "z \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2329
        using mem_affine[of "affine hull S" x1 x2 "e2/(e1+e2)" "e1/(e1+e2)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2330
          x1 x2 affine_affine_hull[of S] *
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2331
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2332
      have "x1 - x2 = (e1 + e2) *\<^sub>R (x - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2333
        using x1_def x2_def by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2334
      then have "x = z+(1/(e1+e2)) *\<^sub>R (x1-x2)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2335
        using e1 e2 by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2336
      then have "x \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2337
        using mem_affine_3_minus[of "affine hull S" z x1 x2 "1/(e1+e2)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2338
          x1 x2 z affine_affine_hull[of S]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2339
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2340
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2341
    then have "affine hull S = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2342
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2343
    then have "aff_dim S = int DIM('n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2344
      using aff_dim_affine_hull[of S] by (simp add: aff_dim_UNIV)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2345
    then have False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2346
      using False by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2347
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2348
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2349
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2350
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2351
  then have "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2352
    using aff_dim_empty[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2353
  have *: "affine hull S = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2354
    using True affine_hull_UNIV by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2355
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2356
    assume "z \<in> interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2357
    then have "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2358
      using True interior_rel_interior_gen[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2359
    then have **: "\<forall>x. \<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2360
      using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> * by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2361
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2362
    obtain e1 where e1: "e1 > 1" "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2363
      using **[rule_format, of "z-x"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2364
    define e where [abs_def]: "e = e1 - 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2365
    then have "(1 - e1) *\<^sub>R (z - x) + e1 *\<^sub>R z = z + e *\<^sub>R x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2366
      by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2367
    then have "e > 0" "z + e *\<^sub>R x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2368
      using e1 e_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2369
    then have "\<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2370
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2371
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2372
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2373
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2374
    assume r: "\<forall>x. \<exists>e. e > 0 \<and> z + e *\<^sub>R x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2375
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2376
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2377
      obtain e1 where e1: "e1 > 0" "z + e1 *\<^sub>R (z - x) \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2378
        using r[rule_format, of "z-x"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2379
      define e where "e = e1 + 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2380
      then have "z + e1 *\<^sub>R (z - x) = (1 - e) *\<^sub>R x + e *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2381
        by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2382
      then have "e > 1" "(1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2383
        using e1 e_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2384
      then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2385
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2386
    then have "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2387
      using convex_rel_interior_iff2[of S z] assms \<open>S \<noteq> {}\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2388
    then have "z \<in> interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2389
      using True interior_rel_interior_gen[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2390
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2391
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2392
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2393
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2394
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  2395
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior and closure under common operations\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2396
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2397
lemma rel_interior_inter_aux: "\<Inter>{rel_interior S |S. S \<in> I} \<subseteq> \<Inter>I"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2398
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2399
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2400
    fix y
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2401
    assume "y \<in> \<Inter>{rel_interior S |S. S \<in> I}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2402
    then have y: "\<forall>S \<in> I. y \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2403
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2404
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2405
      fix S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2406
      assume "S \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2407
      then have "y \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2408
        using rel_interior_subset y by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2409
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2410
    then have "y \<in> \<Inter>I" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2411
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2412
  then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2413
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2414
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2415
lemma closure_Int: "closure (\<Inter>I) \<le> \<Inter>{closure S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2416
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2417
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2418
    fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2419
    assume "y \<in> \<Inter>I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2420
    then have y: "\<forall>S \<in> I. y \<in> S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2421
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2422
      fix S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2423
      assume "S \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2424
      then have "y \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2425
        using closure_subset y by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2426
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2427
    then have "y \<in> \<Inter>{closure S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2428
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2429
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2430
  then have "\<Inter>I \<subseteq> \<Inter>{closure S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2431
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2432
  moreover have "closed (\<Inter>{closure S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2433
    unfolding closed_Inter closed_closure by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2434
  ultimately show ?thesis using closure_hull[of "\<Inter>I"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2435
    hull_minimal[of "\<Inter>I" "\<Inter>{closure S |S. S \<in> I}" "closed"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2436
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2437
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2438
lemma convex_closure_rel_interior_inter:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2439
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2440
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2441
  shows "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2442
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2443
  obtain x where x: "\<forall>S\<in>I. x \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2444
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2445
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2446
    fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2447
    assume "y \<in> \<Inter>{closure S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2448
    then have y: "\<forall>S \<in> I. y \<in> closure S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2449
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2450
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2451
      assume "y = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2452
      then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2453
        using x closure_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2454
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2455
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2456
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2457
      assume "y \<noteq> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2458
      { fix e :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2459
        assume e: "e > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2460
        define e1 where "e1 = min 1 (e/norm (y - x))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2461
        then have e1: "e1 > 0" "e1 \<le> 1" "e1 * norm (y - x) \<le> e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2462
          using \<open>y \<noteq> x\<close> \<open>e > 0\<close> le_divide_eq[of e1 e "norm (y - x)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2463
          by simp_all
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2464
        define z where "z = y - e1 *\<^sub>R (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2465
        {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2466
          fix S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2467
          assume "S \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2468
          then have "z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2469
            using rel_interior_closure_convex_shrink[of S x y e1] assms x y e1 z_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2470
            by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2471
        }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2472
        then have *: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2473
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2474
        have "\<exists>z. z \<in> \<Inter>{rel_interior S |S. S \<in> I} \<and> z \<noteq> y \<and> dist z y \<le> e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2475
          apply (rule_tac x="z" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2476
          using \<open>y \<noteq> x\<close> z_def * e1 e dist_norm[of z y]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2477
          apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2478
          done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2479
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2480
      then have "y islimpt \<Inter>{rel_interior S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2481
        unfolding islimpt_approachable_le by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2482
      then have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2483
        unfolding closure_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2484
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2485
    ultimately have "y \<in> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2486
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2487
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2488
  then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2489
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2490
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2491
lemma convex_closure_inter:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2492
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2493
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2494
  shows "closure (\<Inter>I) = \<Inter>{closure S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2495
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2496
  have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2497
    using convex_closure_rel_interior_inter assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2498
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2499
  have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2500
    using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2501
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2502
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2503
    using closure_Int[of I] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2504
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2505
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2506
lemma convex_inter_rel_interior_same_closure:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2507
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2508
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2509
  shows "closure (\<Inter>{rel_interior S |S. S \<in> I}) = closure (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2510
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2511
  have "\<Inter>{closure S |S. S \<in> I} \<le> closure (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2512
    using convex_closure_rel_interior_inter assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2513
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2514
  have "closure (\<Inter>{rel_interior S |S. S \<in> I}) \<le> closure (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2515
    using rel_interior_inter_aux closure_mono[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2516
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2517
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2518
    using closure_Int[of I] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2519
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2520
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2521
lemma convex_rel_interior_inter:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2522
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2523
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2524
  shows "rel_interior (\<Inter>I) \<subseteq> \<Inter>{rel_interior S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2525
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2526
  have "convex (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2527
    using assms convex_Inter by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2528
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2529
  have "convex (\<Inter>{rel_interior S |S. S \<in> I})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2530
    apply (rule convex_Inter)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2531
    using assms convex_rel_interior
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2532
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2533
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2534
  ultimately
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2535
  have "rel_interior (\<Inter>{rel_interior S |S. S \<in> I}) = rel_interior (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2536
    using convex_inter_rel_interior_same_closure assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2537
      closure_eq_rel_interior_eq[of "\<Inter>{rel_interior S |S. S \<in> I}" "\<Inter>I"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2538
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2539
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2540
    using rel_interior_subset[of "\<Inter>{rel_interior S |S. S \<in> I}"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2541
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2542
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2543
lemma convex_rel_interior_finite_inter:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2544
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2545
    and "\<Inter>{rel_interior S |S. S \<in> I} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2546
    and "finite I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2547
  shows "rel_interior (\<Inter>I) = \<Inter>{rel_interior S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2548
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2549
  have "\<Inter>I \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2550
    using assms rel_interior_inter_aux[of I] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2551
  have "convex (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2552
    using convex_Inter assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2553
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2554
  proof (cases "I = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2555
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2556
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2557
      using Inter_empty rel_interior_UNIV by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2558
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2559
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2560
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2561
      fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2562
      assume z: "z \<in> \<Inter>{rel_interior S |S. S \<in> I}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2563
      {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2564
        fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2565
        assume x: "x \<in> \<Inter>I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2566
        {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2567
          fix S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2568
          assume S: "S \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2569
          then have "z \<in> rel_interior S" "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2570
            using z x by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2571
          then have "\<exists>m. m > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> m \<longrightarrow> (1 - e)*\<^sub>R x + e *\<^sub>R z \<in> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2572
            using convex_rel_interior_if[of S z] S assms hull_subset[of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2573
        }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2574
        then obtain mS where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2575
          mS: "\<forall>S\<in>I. mS S > 1 \<and> (\<forall>e. e > 1 \<and> e \<le> mS S \<longrightarrow> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> S)" by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2576
        define e where "e = Min (mS ` I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2577
        then have "e \<in> mS ` I" using assms \<open>I \<noteq> {}\<close> by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2578
        then have "e > 1" using mS by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2579
        moreover have "\<forall>S\<in>I. e \<le> mS S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2580
          using e_def assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2581
        ultimately have "\<exists>e > 1. (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> \<Inter>I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2582
          using mS by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2583
      }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2584
      then have "z \<in> rel_interior (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2585
        using convex_rel_interior_iff[of "\<Inter>I" z] \<open>\<Inter>I \<noteq> {}\<close> \<open>convex (\<Inter>I)\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2586
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2587
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2588
      using convex_rel_interior_inter[of I] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2589
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2590
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2591
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2592
lemma convex_closure_inter_two:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2593
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2594
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2595
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2596
  assumes "rel_interior S \<inter> rel_interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2597
  shows "closure (S \<inter> T) = closure S \<inter> closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2598
  using convex_closure_inter[of "{S,T}"] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2599
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2600
lemma convex_rel_interior_inter_two:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2601
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2602
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2603
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2604
    and "rel_interior S \<inter> rel_interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2605
  shows "rel_interior (S \<inter> T) = rel_interior S \<inter> rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2606
  using convex_rel_interior_finite_inter[of "{S,T}"] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2607
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2608
lemma convex_affine_closure_Int:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2609
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2610
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2611
    and "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2612
    and "rel_interior S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2613
  shows "closure (S \<inter> T) = closure S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2614
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2615
  have "affine hull T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2616
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2617
  then have "rel_interior T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2618
    using rel_interior_affine_hull[of T] by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2619
  moreover have "closure T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2620
    using assms affine_closed[of T] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2621
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2622
    using convex_closure_inter_two[of S T] assms affine_imp_convex by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2623
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2624
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2625
lemma connected_component_1_gen:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2626
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2627
  assumes "DIM('a) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2628
  shows "connected_component S a b \<longleftrightarrow> closed_segment a b \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2629
unfolding connected_component_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2630
by (metis (no_types, lifting) assms subsetD subsetI convex_contains_segment convex_segment(1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2631
            ends_in_segment connected_convex_1_gen)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2632
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2633
lemma connected_component_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2634
  fixes S :: "real set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2635
  shows "connected_component S a b \<longleftrightarrow> closed_segment a b \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2636
by (simp add: connected_component_1_gen)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2637
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2638
lemma convex_affine_rel_interior_Int:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2639
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2640
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2641
    and "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2642
    and "rel_interior S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2643
  shows "rel_interior (S \<inter> T) = rel_interior S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2644
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2645
  have "affine hull T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2646
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2647
  then have "rel_interior T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2648
    using rel_interior_affine_hull[of T] by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2649
  moreover have "closure T = T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2650
    using assms affine_closed[of T] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2651
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2652
    using convex_rel_interior_inter_two[of S T] assms affine_imp_convex by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2653
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2654
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2655
lemma convex_affine_rel_frontier_Int:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2656
   fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2657
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2658
    and "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2659
    and "interior S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2660
  shows "rel_frontier(S \<inter> T) = frontier S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2661
using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2662
apply (simp add: rel_frontier_def convex_affine_closure_Int frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2663
by (metis Diff_Int_distrib2 Int_emptyI convex_affine_closure_Int convex_affine_rel_interior_Int empty_iff interior_rel_interior_gen)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2664
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2665
lemma rel_interior_convex_Int_affine:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2666
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2667
  assumes "convex S" "affine T" "interior S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2668
    shows "rel_interior(S \<inter> T) = interior S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2669
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2670
  obtain a where aS: "a \<in> interior S" and aT:"a \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2671
    using assms by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2672
  have "rel_interior S = interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2673
    by (metis (no_types) aS affine_hull_nonempty_interior equals0D rel_interior_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2674
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2675
    by (metis (no_types) affine_imp_convex assms convex_rel_interior_inter_two hull_same rel_interior_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2676
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2677
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2678
lemma closure_convex_Int_affine:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2679
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2680
  assumes "convex S" "affine T" "rel_interior S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2681
  shows "closure(S \<inter> T) = closure S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2682
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2683
  have "closure (S \<inter> T) \<subseteq> closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2684
    by (simp add: closure_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2685
  also have "... \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2686
    by (simp add: affine_closed assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2687
  finally show "closure(S \<inter> T) \<subseteq> closure S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2688
    by (simp add: closure_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2689
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2690
  obtain a where "a \<in> rel_interior S" "a \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2691
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2692
  then have ssT: "subspace ((\<lambda>x. (-a)+x) ` T)" and "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2693
    using affine_diffs_subspace rel_interior_subset assms by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2694
  show "closure S \<inter> T \<subseteq> closure (S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2695
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2696
    fix x  assume "x \<in> closure S \<inter> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2697
    show "x \<in> closure (S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2698
    proof (cases "x = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2699
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2700
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2701
        using \<open>a \<in> S\<close> \<open>a \<in> T\<close> closure_subset by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2702
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2703
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2704
      then have "x \<in> closure(open_segment a x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2705
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2706
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2707
        using \<open>x \<in> closure S \<inter> T\<close> assms convex_affine_closure_Int by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2708
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2709
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2710
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2711
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2712
lemma subset_rel_interior_convex:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2713
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2714
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2715
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2716
    and "S \<le> closure T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2717
    and "\<not> S \<subseteq> rel_frontier T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2718
  shows "rel_interior S \<subseteq> rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2719
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2720
  have *: "S \<inter> closure T = S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2721
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2722
  have "\<not> rel_interior S \<subseteq> rel_frontier T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2723
    using closure_mono[of "rel_interior S" "rel_frontier T"] closed_rel_frontier[of T]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2724
      closure_closed[of S] convex_closure_rel_interior[of S] closure_subset[of S] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2725
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2726
  then have "rel_interior S \<inter> rel_interior (closure T) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2727
    using assms rel_frontier_def[of T] rel_interior_subset convex_rel_interior_closure[of T]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2728
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2729
  then have "rel_interior S \<inter> rel_interior T = rel_interior (S \<inter> closure T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2730
    using assms convex_closure convex_rel_interior_inter_two[of S "closure T"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2731
      convex_rel_interior_closure[of T]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2732
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2733
  also have "\<dots> = rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2734
    using * by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2735
  finally show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2736
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2737
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2738
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2739
lemma rel_interior_convex_linear_image:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2740
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2741
  assumes "linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2742
    and "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2743
  shows "f ` (rel_interior S) = rel_interior (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2744
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2745
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2746
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2747
    using assms rel_interior_empty rel_interior_eq_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2748
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2749
  case False
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2750
  interpret linear f by fact
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2751
  have *: "f ` (rel_interior S) \<subseteq> f ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2752
    unfolding image_mono using rel_interior_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2753
  have "f ` S \<subseteq> f ` (closure S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2754
    unfolding image_mono using closure_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2755
  also have "\<dots> = f ` (closure (rel_interior S))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2756
    using convex_closure_rel_interior assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2757
  also have "\<dots> \<subseteq> closure (f ` (rel_interior S))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2758
    using closure_linear_image_subset assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2759
  finally have "closure (f ` S) = closure (f ` rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2760
    using closure_mono[of "f ` S" "closure (f ` rel_interior S)"] closure_closure
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2761
      closure_mono[of "f ` rel_interior S" "f ` S"] *
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2762
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2763
  then have "rel_interior (f ` S) = rel_interior (f ` rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2764
    using assms convex_rel_interior
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2765
      linear_conv_bounded_linear[of f] convex_linear_image[of _ S]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2766
      convex_linear_image[of _ "rel_interior S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2767
      closure_eq_rel_interior_eq[of "f ` S" "f ` rel_interior S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2768
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2769
  then have "rel_interior (f ` S) \<subseteq> f ` rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2770
    using rel_interior_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2771
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2772
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2773
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2774
    assume "z \<in> f ` rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2775
    then obtain z1 where z1: "z1 \<in> rel_interior S" "f z1 = z" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2776
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2777
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2778
      assume "x \<in> f ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2779
      then obtain x1 where x1: "x1 \<in> S" "f x1 = x" by auto
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2780
      then obtain e where e: "e > 1" "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1 \<in> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2781
        using convex_rel_interior_iff[of S z1] \<open>convex S\<close> x1 z1 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2782
      moreover have "f ((1 - e) *\<^sub>R x1 + e *\<^sub>R z1) = (1 - e) *\<^sub>R x + e *\<^sub>R z"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2783
        using x1 z1 by (simp add: linear_add linear_scale \<open>linear f\<close>)
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2784
      ultimately have "(1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2785
        using imageI[of "(1 - e) *\<^sub>R x1 + e *\<^sub>R z1" S f] by auto
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2786
      then have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2787
        using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2788
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2789
    then have "z \<in> rel_interior (f ` S)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2790
      using convex_rel_interior_iff[of "f ` S" z] \<open>convex S\<close> \<open>linear f\<close>
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2791
        \<open>S \<noteq> {}\<close> convex_linear_image[of f S]  linear_conv_bounded_linear[of f]
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2792
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2793
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2794
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2795
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2796
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2797
lemma rel_interior_convex_linear_preimage:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2798
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2799
  assumes "linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2800
    and "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2801
    and "f -` (rel_interior S) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2802
  shows "rel_interior (f -` S) = f -` (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2803
proof -
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2804
  interpret linear f by fact
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2805
  have "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2806
    using assms rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2807
  have nonemp: "f -` S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2808
    by (metis assms(3) rel_interior_subset subset_empty vimage_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2809
  then have "S \<inter> (range f) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2810
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2811
  have conv: "convex (f -` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2812
    using convex_linear_vimage assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2813
  then have "convex (S \<inter> range f)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2814
    by (simp add: assms(2) convex_Int convex_linear_image linear_axioms)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2815
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2816
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2817
    assume "z \<in> f -` (rel_interior S)"
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  2818
    then have z: "f z \<in> rel_interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2819
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2820
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2821
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2822
      assume "x \<in> f -` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2823
      then have "f x \<in> S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2824
      then obtain e where e: "e > 1" "(1 - e) *\<^sub>R f x + e *\<^sub>R f z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2825
        using convex_rel_interior_iff[of S "f z"] z assms \<open>S \<noteq> {}\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2826
      moreover have "(1 - e) *\<^sub>R f x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R x + e *\<^sub>R z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2827
        using \<open>linear f\<close> by (simp add: linear_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2828
      ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R z \<in> f -` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2829
        using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2830
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2831
    then have "z \<in> rel_interior (f -` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2832
      using convex_rel_interior_iff[of "f -` S" z] conv nonemp by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2833
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2834
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2835
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2836
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2837
    assume z: "z \<in> rel_interior (f -` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2838
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2839
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2840
      assume "x \<in> S \<inter> range f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2841
      then obtain y where y: "f y = x" "y \<in> f -` S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2842
      then obtain e where e: "e > 1" "(1 - e) *\<^sub>R y + e *\<^sub>R z \<in> f -` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2843
        using convex_rel_interior_iff[of "f -` S" z] z conv by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2844
      moreover have "(1 - e) *\<^sub>R x + e *\<^sub>R f z = f ((1 - e) *\<^sub>R y + e *\<^sub>R z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2845
        using \<open>linear f\<close> y by (simp add: linear_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2846
      ultimately have "\<exists>e. e > 1 \<and> (1 - e) *\<^sub>R x + e *\<^sub>R f z \<in> S \<inter> range f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2847
        using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2848
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2849
    then have "f z \<in> rel_interior (S \<inter> range f)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2850
      using \<open>convex (S \<inter> (range f))\<close> \<open>S \<inter> range f \<noteq> {}\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2851
        convex_rel_interior_iff[of "S \<inter> (range f)" "f z"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2852
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2853
    moreover have "affine (range f)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  2854
      by (simp add: linear_axioms linear_subspace_image subspace_imp_affine)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2855
    ultimately have "f z \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2856
      using convex_affine_rel_interior_Int[of S "range f"] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2857
    then have "z \<in> f -` (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2858
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2859
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2860
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2861
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2862
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2863
lemma rel_interior_Times:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2864
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2865
    and T :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2866
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2867
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2868
  shows "rel_interior (S \<times> T) = rel_interior S \<times> rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2869
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2870
  { assume "S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2871
    then have ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2872
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2873
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2874
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2875
  { assume "T = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2876
    then have ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2877
       by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2878
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2879
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2880
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2881
    assume "S \<noteq> {}" "T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2882
    then have ri: "rel_interior S \<noteq> {}" "rel_interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2883
      using rel_interior_eq_empty assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2884
    then have "fst -` rel_interior S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2885
      using fst_vimage_eq_Times[of "rel_interior S"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2886
    then have "rel_interior ((fst :: 'n * 'm \<Rightarrow> 'n) -` S) = fst -` rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2887
      using fst_linear \<open>convex S\<close> rel_interior_convex_linear_preimage[of fst S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2888
    then have s: "rel_interior (S \<times> (UNIV :: 'm set)) = rel_interior S \<times> UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2889
      by (simp add: fst_vimage_eq_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2890
    from ri have "snd -` rel_interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2891
      using snd_vimage_eq_Times[of "rel_interior T"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2892
    then have "rel_interior ((snd :: 'n * 'm \<Rightarrow> 'm) -` T) = snd -` rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2893
      using snd_linear \<open>convex T\<close> rel_interior_convex_linear_preimage[of snd T] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2894
    then have t: "rel_interior ((UNIV :: 'n set) \<times> T) = UNIV \<times> rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2895
      by (simp add: snd_vimage_eq_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2896
    from s t have *: "rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2897
      rel_interior S \<times> rel_interior T" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2898
    have "S \<times> T = S \<times> (UNIV :: 'm set) \<inter> (UNIV :: 'n set) \<times> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2899
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2900
    then have "rel_interior (S \<times> T) = rel_interior ((S \<times> (UNIV :: 'm set)) \<inter> ((UNIV :: 'n set) \<times> T))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2901
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2902
    also have "\<dots> = rel_interior (S \<times> (UNIV :: 'm set)) \<inter> rel_interior ((UNIV :: 'n set) \<times> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2903
       apply (subst convex_rel_interior_inter_two[of "S \<times> (UNIV :: 'm set)" "(UNIV :: 'n set) \<times> T"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2904
       using * ri assms convex_Times
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2905
       apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2906
       done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2907
    finally have ?thesis using * by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2908
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2909
  ultimately show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2910
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2911
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2912
lemma rel_interior_scaleR:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2913
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2914
  assumes "c \<noteq> 0"
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  2915
  shows "((*\<^sub>R) c) ` (rel_interior S) = rel_interior (((*\<^sub>R) c) ` S)"
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  2916
  using rel_interior_injective_linear_image[of "((*\<^sub>R) c)" S]
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  2917
    linear_conv_bounded_linear[of "(*\<^sub>R) c"] linear_scaleR injective_scaleR[of c] assms
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2918
  by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2919
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2920
lemma rel_interior_convex_scaleR:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2921
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2922
  assumes "convex S"
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  2923
  shows "((*\<^sub>R) c) ` (rel_interior S) = rel_interior (((*\<^sub>R) c) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2924
  by (metis assms linear_scaleR rel_interior_convex_linear_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2925
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2926
lemma convex_rel_open_scaleR:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2927
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2928
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2929
    and "rel_open S"
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  2930
  shows "convex (((*\<^sub>R) c) ` S) \<and> rel_open (((*\<^sub>R) c) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2931
  by (metis assms convex_scaling rel_interior_convex_scaleR rel_open_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2932
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2933
lemma convex_rel_open_finite_inter:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2934
  assumes "\<forall>S\<in>I. convex (S :: 'n::euclidean_space set) \<and> rel_open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2935
    and "finite I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2936
  shows "convex (\<Inter>I) \<and> rel_open (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2937
proof (cases "\<Inter>{rel_interior S |S. S \<in> I} = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2938
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2939
  then have "\<Inter>I = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2940
    using assms unfolding rel_open_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2941
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2942
    unfolding rel_open_def using rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2943
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2944
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2945
  then have "rel_open (\<Inter>I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2946
    using assms unfolding rel_open_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2947
    using convex_rel_interior_finite_inter[of I]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2948
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2949
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2950
    using convex_Inter assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2951
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2952
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2953
lemma convex_rel_open_linear_image:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2954
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2955
  assumes "linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2956
    and "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2957
    and "rel_open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2958
  shows "convex (f ` S) \<and> rel_open (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2959
  by (metis assms convex_linear_image rel_interior_convex_linear_image rel_open_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2960
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2961
lemma convex_rel_open_linear_preimage:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2962
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2963
  assumes "linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2964
    and "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2965
    and "rel_open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2966
  shows "convex (f -` S) \<and> rel_open (f -` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2967
proof (cases "f -` (rel_interior S) = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2968
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2969
  then have "f -` S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2970
    using assms unfolding rel_open_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2971
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2972
    unfolding rel_open_def using rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2973
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2974
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2975
  then have "rel_open (f -` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2976
    using assms unfolding rel_open_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2977
    using rel_interior_convex_linear_preimage[of f S]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2978
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2979
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2980
    using convex_linear_vimage assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2981
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2982
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2983
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2984
lemma rel_interior_projection:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2985
  fixes S :: "('m::euclidean_space \<times> 'n::euclidean_space) set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2986
    and f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2987
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2988
    and "f = (\<lambda>y. {z. (y, z) \<in> S})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2989
  shows "(y, z) \<in> rel_interior S \<longleftrightarrow> (y \<in> rel_interior {y. (f y \<noteq> {})} \<and> z \<in> rel_interior (f y))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2990
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2991
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2992
    fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2993
    assume "y \<in> {y. f y \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2994
    then obtain z where "(y, z) \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2995
      using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2996
    then have "\<exists>x. x \<in> S \<and> y = fst x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2997
      apply (rule_tac x="(y, z)" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2998
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  2999
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3000
    then obtain x where "x \<in> S" "y = fst x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3001
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3002
    then have "y \<in> fst ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3003
      unfolding image_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3004
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3005
  then have "fst ` S = {y. f y \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3006
    unfolding fst_def using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3007
  then have h1: "fst ` rel_interior S = rel_interior {y. f y \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3008
    using rel_interior_convex_linear_image[of fst S] assms fst_linear by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3009
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3010
    fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3011
    assume "y \<in> rel_interior {y. f y \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3012
    then have "y \<in> fst ` rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3013
      using h1 by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3014
    then have *: "rel_interior S \<inter> fst -` {y} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3015
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3016
    moreover have aff: "affine (fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3017
      unfolding affine_alt by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3018
    ultimately have **: "rel_interior (S \<inter> fst -` {y}) = rel_interior S \<inter> fst -` {y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3019
      using convex_affine_rel_interior_Int[of S "fst -` {y}"] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3020
    have conv: "convex (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3021
      using convex_Int assms aff affine_imp_convex by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3022
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3023
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3024
      assume "x \<in> f y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3025
      then have "(y, x) \<in> S \<inter> (fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3026
        using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3027
      moreover have "x = snd (y, x)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3028
      ultimately have "x \<in> snd ` (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3029
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3030
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3031
    then have "snd ` (S \<inter> fst -` {y}) = f y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3032
      using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3033
    then have ***: "rel_interior (f y) = snd ` rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3034
      using rel_interior_convex_linear_image[of snd "S \<inter> fst -` {y}"] snd_linear conv
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3035
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3036
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3037
      fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3038
      assume "z \<in> rel_interior (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3039
      then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3040
        using *** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3041
      moreover have "{y} = fst ` rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3042
        using * ** rel_interior_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3043
      ultimately have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3044
        by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3045
      then have "(y,z) \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3046
        using ** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3047
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3048
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3049
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3050
      fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3051
      assume "(y, z) \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3052
      then have "(y, z) \<in> rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3053
        using ** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3054
      then have "z \<in> snd ` rel_interior (S \<inter> fst -` {y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3055
        by (metis Range_iff snd_eq_Range)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3056
      then have "z \<in> rel_interior (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3057
        using *** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3058
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3059
    ultimately have "\<And>z. (y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3060
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3061
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3062
  then have h2: "\<And>y z. y \<in> rel_interior {t. f t \<noteq> {}} \<Longrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3063
    (y, z) \<in> rel_interior S \<longleftrightarrow> z \<in> rel_interior (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3064
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3065
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3066
    fix y z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3067
    assume asm: "(y, z) \<in> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3068
    then have "y \<in> fst ` rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3069
      by (metis Domain_iff fst_eq_Domain)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3070
    then have "y \<in> rel_interior {t. f t \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3071
      using h1 by auto
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  3072
    then have "y \<in> rel_interior {t. f t \<noteq> {}}" and "(z \<in> rel_interior (f y))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3073
      using h2 asm by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3074
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3075
  then show ?thesis using h2 by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3076
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3077
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3078
lemma rel_frontier_Times:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3079
  fixes S :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3080
    and T :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3081
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3082
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3083
  shows "rel_frontier S \<times> rel_frontier T \<subseteq> rel_frontier (S \<times> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3084
    by (force simp: rel_frontier_def rel_interior_Times assms closure_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3085
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3086
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  3087
subsubsection\<^marker>\<open>tag unimportant\<close> \<open>Relative interior of convex cone\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3088
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3089
lemma cone_rel_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3090
  fixes S :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3091
  assumes "cone S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3092
  shows "cone ({0} \<union> rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3093
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3094
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3095
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3096
    by (simp add: rel_interior_empty cone_0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3097
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3098
  case False
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  3099
  then have *: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` S = S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3100
    using cone_iff[of S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3101
  then have *: "0 \<in> ({0} \<union> rel_interior S)"
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  3102
    and "\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` ({0} \<union> rel_interior S) = ({0} \<union> rel_interior S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3103
    by (auto simp add: rel_interior_scaleR)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3104
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3105
    using cone_iff[of "{0} \<union> rel_interior S"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3106
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3107
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3108
lemma rel_interior_convex_cone_aux:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3109
  fixes S :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3110
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3111
  shows "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) \<longleftrightarrow>
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  3112
    c > 0 \<and> x \<in> (((*\<^sub>R) c) ` (rel_interior S))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3113
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3114
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3115
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3116
    by (simp add: rel_interior_empty cone_hull_empty)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3117
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3118
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3119
  then obtain s where "s \<in> S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3120
  have conv: "convex ({(1 :: real)} \<times> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3121
    using convex_Times[of "{(1 :: real)}" S] assms convex_singleton[of "1 :: real"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3122
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3123
  define f where "f y = {z. (y, z) \<in> cone hull ({1 :: real} \<times> S)}" for y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3124
  then have *: "(c, x) \<in> rel_interior (cone hull ({(1 :: real)} \<times> S)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3125
    (c \<in> rel_interior {y. f y \<noteq> {}} \<and> x \<in> rel_interior (f c))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3126
    apply (subst rel_interior_projection[of "cone hull ({(1 :: real)} \<times> S)" f c x])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3127
    using convex_cone_hull[of "{(1 :: real)} \<times> S"] conv
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3128
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3129
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3130
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3131
    fix y :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3132
    assume "y \<ge> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3133
    then have "y *\<^sub>R (1,s) \<in> cone hull ({1 :: real} \<times> S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3134
      using cone_hull_expl[of "{(1 :: real)} \<times> S"] \<open>s \<in> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3135
    then have "f y \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3136
      using f_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3137
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3138
  then have "{y. f y \<noteq> {}} = {0..}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3139
    using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3140
  then have **: "rel_interior {y. f y \<noteq> {}} = {0<..}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3141
    using rel_interior_real_semiline by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3142
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3143
    fix c :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3144
    assume "c > 0"
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  3145
    then have "f c = ((*\<^sub>R) c ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3146
      using f_def cone_hull_expl[of "{1 :: real} \<times> S"] by auto
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  3147
    then have "rel_interior (f c) = (*\<^sub>R) c ` rel_interior S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3148
      using rel_interior_convex_scaleR[of S c] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3149
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3150
  then show ?thesis using * ** by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3151
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3152
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3153
lemma rel_interior_convex_cone:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3154
  fixes S :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3155
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3156
  shows "rel_interior (cone hull ({1 :: real} \<times> S)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3157
    {(c, c *\<^sub>R x) | c x. c > 0 \<and> x \<in> rel_interior S}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3158
  (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3159
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3160
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3161
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3162
    assume "z \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3163
    have *: "z = (fst z, snd z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3164
      by auto
71004
b86d30707837 just tidied one proof
paulson <lp15@cam.ac.uk>
parents: 70817
diff changeset
  3165
    then have "z \<in> ?rhs"
b86d30707837 just tidied one proof
paulson <lp15@cam.ac.uk>
parents: 70817
diff changeset
  3166
      using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms \<open>z \<in> ?lhs\<close> by fastforce
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3167
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3168
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3169
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3170
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3171
    assume "z \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3172
    then have "z \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3173
      using rel_interior_convex_cone_aux[of S "fst z" "snd z"] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3174
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3175
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3176
  ultimately show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3177
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3178
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3179
lemma convex_hull_finite_union:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3180
  assumes "finite I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3181
  assumes "\<forall>i\<in>I. convex (S i) \<and> (S i) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3182
  shows "convex hull (\<Union>(S ` I)) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3183
    {sum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3184
  (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3185
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3186
  have "?lhs \<supseteq> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3187
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3188
    fix x
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  3189
    assume "x \<in> ?rhs"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3190
    then obtain c s where *: "sum (\<lambda>i. c i *\<^sub>R s i) I = x" "sum c I = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3191
      "(\<forall>i\<in>I. c i \<ge> 0) \<and> (\<forall>i\<in>I. s i \<in> S i)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3192
    then have "\<forall>i\<in>I. s i \<in> convex hull (\<Union>(S ` I))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3193
      using hull_subset[of "\<Union>(S ` I)" convex] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3194
    then show "x \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3195
      unfolding *(1)[symmetric]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3196
      apply (subst convex_sum[of I "convex hull \<Union>(S ` I)" c s])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3197
      using * assms convex_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3198
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3199
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3200
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3201
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3202
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3203
    fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3204
    assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3205
    with assms have "\<exists>p. p \<in> S i" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3206
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3207
  then obtain p where p: "\<forall>i\<in>I. p i \<in> S i" by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3208
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3209
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3210
    fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3211
    assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3212
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3213
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3214
      assume "x \<in> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3215
      define c where "c j = (if j = i then 1::real else 0)" for j
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3216
      then have *: "sum c I = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3217
        using \<open>finite I\<close> \<open>i \<in> I\<close> sum.delta[of I i "\<lambda>j::'a. 1::real"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3218
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3219
      define s where "s j = (if j = i then x else p j)" for j
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3220
      then have "\<forall>j. c j *\<^sub>R s j = (if j = i then x else 0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3221
        using c_def by (auto simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3222
      then have "x = sum (\<lambda>i. c i *\<^sub>R s i) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3223
        using s_def c_def \<open>finite I\<close> \<open>i \<in> I\<close> sum.delta[of I i "\<lambda>j::'a. x"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3224
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3225
      then have "x \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3226
        apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3227
        apply (rule_tac x = c in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3228
        apply (rule_tac x = s in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3229
        using * c_def s_def p \<open>x \<in> S i\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3230
        apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3231
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3232
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3233
    then have "?rhs \<supseteq> S i" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3234
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3235
  then have *: "?rhs \<supseteq> \<Union>(S ` I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3236
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3237
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3238
    fix u v :: real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3239
    assume uv: "u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3240
    fix x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3241
    assume xy: "x \<in> ?rhs \<and> y \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3242
    from xy obtain c s where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3243
      xc: "x = sum (\<lambda>i. c i *\<^sub>R s i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3244
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3245
    from xy obtain d t where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3246
      yc: "y = sum (\<lambda>i. d i *\<^sub>R t i) I \<and> (\<forall>i\<in>I. d i \<ge> 0) \<and> sum d I = 1 \<and> (\<forall>i\<in>I. t i \<in> S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3247
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3248
    define e where "e i = u * c i + v * d i" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3249
    have ge0: "\<forall>i\<in>I. e i \<ge> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3250
      using e_def xc yc uv by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3251
    have "sum (\<lambda>i. u * c i) I = u * sum c I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3252
      by (simp add: sum_distrib_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3253
    moreover have "sum (\<lambda>i. v * d i) I = v * sum d I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3254
      by (simp add: sum_distrib_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3255
    ultimately have sum1: "sum e I = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3256
      using e_def xc yc uv by (simp add: sum.distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3257
    define q where "q i = (if e i = 0 then p i else (u * c i / e i) *\<^sub>R s i + (v * d i / e i) *\<^sub>R t i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3258
      for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3259
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3260
      fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3261
      assume i: "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3262
      have "q i \<in> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3263
      proof (cases "e i = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3264
        case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3265
        then show ?thesis using i p q_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3266
      next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3267
        case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3268
        then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3269
          using mem_convex_alt[of "S i" "s i" "t i" "u * (c i)" "v * (d i)"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3270
            mult_nonneg_nonneg[of u "c i"] mult_nonneg_nonneg[of v "d i"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3271
            assms q_def e_def i False xc yc uv
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3272
          by (auto simp del: mult_nonneg_nonneg)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3273
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3274
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3275
    then have qs: "\<forall>i\<in>I. q i \<in> S i" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3276
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3277
      fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3278
      assume i: "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3279
      have "(u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i = e i *\<^sub>R q i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3280
      proof (cases "e i = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3281
        case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3282
        have ge: "u * (c i) \<ge> 0 \<and> v * d i \<ge> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3283
          using xc yc uv i by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3284
        moreover from ge have "u * c i \<le> 0 \<and> v * d i \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3285
          using True e_def i by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3286
        ultimately have "u * c i = 0 \<and> v * d i = 0" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3287
        with True show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3288
      next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3289
        case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3290
        then have "(u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i) = q i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3291
          using q_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3292
        then have "e i *\<^sub>R ((u * (c i)/(e i))*\<^sub>R (s i)+(v * (d i)/(e i))*\<^sub>R (t i))
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3293
               = (e i) *\<^sub>R (q i)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3294
        with False show ?thesis by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3295
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3296
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3297
    then have *: "\<forall>i\<in>I. (u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i = e i *\<^sub>R q i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3298
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3299
    have "u *\<^sub>R x + v *\<^sub>R y = sum (\<lambda>i. (u * c i) *\<^sub>R s i + (v * d i) *\<^sub>R t i) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3300
      using xc yc by (simp add: algebra_simps scaleR_right.sum sum.distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3301
    also have "\<dots> = sum (\<lambda>i. e i *\<^sub>R q i) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3302
      using * by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3303
    finally have "u *\<^sub>R x + v *\<^sub>R y = sum (\<lambda>i. (e i) *\<^sub>R (q i)) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3304
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3305
    then have "u *\<^sub>R x + v *\<^sub>R y \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3306
      using ge0 sum1 qs by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3307
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3308
  then have "convex ?rhs" unfolding convex_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3309
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3310
    using \<open>?lhs \<supseteq> ?rhs\<close> * hull_minimal[of "\<Union>(S ` I)" ?rhs convex]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3311
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3312
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3313
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3314
lemma convex_hull_union_two:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3315
  fixes S T :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3316
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3317
    and "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3318
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3319
    and "T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3320
  shows "convex hull (S \<union> T) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3321
    {u *\<^sub>R s + v *\<^sub>R t | u v s t. u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1 \<and> s \<in> S \<and> t \<in> T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3322
  (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3323
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3324
  define I :: "nat set" where "I = {1, 2}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3325
  define s where "s i = (if i = (1::nat) then S else T)" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3326
  have "\<Union>(s ` I) = S \<union> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3327
    using s_def I_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3328
  then have "convex hull (\<Union>(s ` I)) = convex hull (S \<union> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3329
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3330
  moreover have "convex hull \<Union>(s ` I) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3331
    {\<Sum> i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3332
      apply (subst convex_hull_finite_union[of I s])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3333
      using assms s_def I_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3334
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3335
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3336
  moreover have
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3337
    "{\<Sum>i\<in>I. c i *\<^sub>R sa i | c sa. (\<forall>i\<in>I. 0 \<le> c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. sa i \<in> s i)} \<le> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3338
    using s_def I_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3339
  ultimately show "?lhs \<subseteq> ?rhs" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3340
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3341
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3342
    assume "x \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3343
    then obtain u v s t where *: "x = u *\<^sub>R s + v *\<^sub>R t \<and> u \<ge> 0 \<and> v \<ge> 0 \<and> u + v = 1 \<and> s \<in> S \<and> t \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3344
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3345
    then have "x \<in> convex hull {s, t}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3346
      using convex_hull_2[of s t] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3347
    then have "x \<in> convex hull (S \<union> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3348
      using * hull_mono[of "{s, t}" "S \<union> T"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3349
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3350
  then show "?lhs \<supseteq> ?rhs" by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3351
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3352
70620
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3353
proposition ray_to_rel_frontier:
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3354
  fixes a :: "'a::real_inner"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3355
  assumes "bounded S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3356
      and a: "a \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3357
      and aff: "(a + l) \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3358
      and "l \<noteq> 0"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3359
  obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3360
           "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3361
proof -
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3362
  have aaff: "a \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3363
    by (meson a hull_subset rel_interior_subset rev_subsetD)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3364
  let ?D = "{d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3365
  obtain B where "B > 0" and B: "S \<subseteq> ball a B"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3366
    using bounded_subset_ballD [OF \<open>bounded S\<close>] by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3367
  have "a + (B / norm l) *\<^sub>R l \<notin> ball a B"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3368
    by (simp add: dist_norm \<open>l \<noteq> 0\<close>)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3369
  with B have "a + (B / norm l) *\<^sub>R l \<notin> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3370
    using rel_interior_subset subsetCE by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3371
  with \<open>B > 0\<close> \<open>l \<noteq> 0\<close> have nonMT: "?D \<noteq> {}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3372
    using divide_pos_pos zero_less_norm_iff by fastforce
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3373
  have bdd: "bdd_below ?D"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3374
    by (metis (no_types, lifting) bdd_belowI le_less mem_Collect_eq)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3375
  have relin_Ex: "\<And>x. x \<in> rel_interior S \<Longrightarrow>
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3376
                    \<exists>e>0. \<forall>x'\<in>affine hull S. dist x' x < e \<longrightarrow> x' \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3377
    using openin_rel_interior [of S] by (simp add: openin_euclidean_subtopology_iff)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3378
  define d where "d = Inf ?D"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3379
  obtain \<epsilon> where "0 < \<epsilon>" and \<epsilon>: "\<And>\<eta>. \<lbrakk>0 \<le> \<eta>; \<eta> < \<epsilon>\<rbrakk> \<Longrightarrow> (a + \<eta> *\<^sub>R l) \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3380
  proof -
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3381
    obtain e where "e>0"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3382
            and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' a < e \<Longrightarrow> x' \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3383
      using relin_Ex a by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3384
    show thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3385
    proof (rule_tac \<epsilon> = "e / norm l" in that)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3386
      show "0 < e / norm l" by (simp add: \<open>0 < e\<close> \<open>l \<noteq> 0\<close>)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3387
    next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3388
      show "a + \<eta> *\<^sub>R l \<in> rel_interior S" if "0 \<le> \<eta>" "\<eta> < e / norm l" for \<eta>
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3389
      proof (rule e)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3390
        show "a + \<eta> *\<^sub>R l \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3391
          by (metis (no_types) add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3392
        show "dist (a + \<eta> *\<^sub>R l) a < e"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3393
          using that by (simp add: \<open>l \<noteq> 0\<close> dist_norm pos_less_divide_eq)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3394
      qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3395
    qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3396
  qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3397
  have inint: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> a + e *\<^sub>R l \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3398
    unfolding d_def using cInf_lower [OF _ bdd]
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3399
    by (metis (no_types, lifting) a add.right_neutral le_less mem_Collect_eq not_less real_vector.scale_zero_left)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3400
  have "\<epsilon> \<le> d"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3401
    unfolding d_def
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3402
    apply (rule cInf_greatest [OF nonMT])
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3403
    using \<epsilon> dual_order.strict_implies_order le_less_linear by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3404
  with \<open>0 < \<epsilon>\<close> have "0 < d" by simp
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3405
  have "a + d *\<^sub>R l \<notin> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3406
  proof
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3407
    assume adl: "a + d *\<^sub>R l \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3408
    obtain e where "e > 0"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3409
             and e: "\<And>x'. x' \<in> affine hull S \<Longrightarrow> dist x' (a + d *\<^sub>R l) < e \<Longrightarrow> x' \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3410
      using relin_Ex adl by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3411
    have "d + e / norm l \<le> Inf {d. 0 < d \<and> a + d *\<^sub>R l \<notin> rel_interior S}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3412
    proof (rule cInf_greatest [OF nonMT], clarsimp)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3413
      fix x::real
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3414
      assume "0 < x" and nonrel: "a + x *\<^sub>R l \<notin> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3415
      show "d + e / norm l \<le> x"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3416
      proof (cases "x < d")
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3417
        case True with inint nonrel \<open>0 < x\<close>
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3418
          show ?thesis by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3419
      next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3420
        case False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3421
          then have dle: "x < d + e / norm l \<Longrightarrow> dist (a + x *\<^sub>R l) (a + d *\<^sub>R l) < e"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3422
            by (simp add: field_simps \<open>l \<noteq> 0\<close>)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3423
          have ain: "a + x *\<^sub>R l \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3424
            by (metis add_diff_cancel_left' aff affine_affine_hull mem_affine_3_minus aaff)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3425
          show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3426
            using e [OF ain] nonrel dle by force
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3427
      qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3428
    qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3429
    then show False
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  3430
      using \<open>0 < e\<close> \<open>l \<noteq> 0\<close> by (simp add: d_def [symmetric] field_simps)
70620
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3431
  qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3432
  moreover have "a + d *\<^sub>R l \<in> closure S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3433
  proof (clarsimp simp: closure_approachable)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3434
    fix \<eta>::real assume "0 < \<eta>"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3435
    have 1: "a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l \<in> S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3436
      apply (rule subsetD [OF rel_interior_subset inint])
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3437
      using \<open>l \<noteq> 0\<close> \<open>0 < d\<close> \<open>0 < \<eta>\<close> by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3438
    have "norm l * min d (\<eta> / (norm l * 2)) \<le> norm l * (\<eta> / (norm l * 2))"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3439
      by (metis min_def mult_left_mono norm_ge_zero order_refl)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3440
    also have "... < \<eta>"
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  3441
      using \<open>l \<noteq> 0\<close> \<open>0 < \<eta>\<close> by (simp add: field_simps)
70620
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3442
    finally have 2: "norm l * min d (\<eta> / (norm l * 2)) < \<eta>" .
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3443
    show "\<exists>y\<in>S. dist y (a + d *\<^sub>R l) < \<eta>"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3444
      apply (rule_tac x="a + (d - min d (\<eta> / 2 / norm l)) *\<^sub>R l" in bexI)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3445
      using 1 2 \<open>0 < d\<close> \<open>0 < \<eta>\<close> apply (auto simp: algebra_simps)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3446
      done
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3447
  qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3448
  ultimately have infront: "a + d *\<^sub>R l \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3449
    by (simp add: rel_frontier_def)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3450
  show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3451
    by (rule that [OF \<open>0 < d\<close> infront inint])
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3452
qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3453
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3454
corollary ray_to_frontier:
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3455
  fixes a :: "'a::euclidean_space"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3456
  assumes "bounded S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3457
      and a: "a \<in> interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3458
      and "l \<noteq> 0"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3459
  obtains d where "0 < d" "(a + d *\<^sub>R l) \<in> frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3460
           "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (a + e *\<^sub>R l) \<in> interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3461
proof -
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3462
  have "interior S = rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3463
    using a rel_interior_nonempty_interior by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3464
  then have "a \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3465
    using a by simp
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3466
  then show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3467
    apply (rule ray_to_rel_frontier [OF \<open>bounded S\<close> _ _ \<open>l \<noteq> 0\<close>])
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3468
     using a affine_hull_nonempty_interior apply blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3469
    by (simp add: \<open>interior S = rel_interior S\<close> frontier_def rel_frontier_def that)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3470
qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3471
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3472
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3473
lemma segment_to_rel_frontier_aux:
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3474
  fixes x :: "'a::euclidean_space"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3475
  assumes "convex S" "bounded S" and x: "x \<in> rel_interior S" and y: "y \<in> S" and xy: "x \<noteq> y"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3476
  obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3477
                   "open_segment x z \<subseteq> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3478
proof -
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3479
  have "x + (y - x) \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3480
    using hull_inc [OF y] by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3481
  then obtain d where "0 < d" and df: "(x + d *\<^sub>R (y-x)) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3482
                  and di: "\<And>e. \<lbrakk>0 \<le> e; e < d\<rbrakk> \<Longrightarrow> (x + e *\<^sub>R (y-x)) \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3483
    by (rule ray_to_rel_frontier [OF \<open>bounded S\<close> x]) (use xy in auto)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3484
  show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3485
  proof
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3486
    show "x + d *\<^sub>R (y - x) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3487
      by (simp add: df)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3488
  next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3489
    have "open_segment x y \<subseteq> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3490
      using rel_interior_closure_convex_segment [OF \<open>convex S\<close> x] closure_subset y by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3491
    moreover have "x + d *\<^sub>R (y - x) \<in> open_segment x y" if "d < 1"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3492
      using xy
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3493
      apply (auto simp: in_segment)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3494
      apply (rule_tac x="d" in exI)
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  3495
      using \<open>0 < d\<close> that apply (auto simp: algebra_simps)
70620
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3496
      done
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3497
    ultimately have "1 \<le> d"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3498
      using df rel_frontier_def by fastforce
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3499
    moreover have "x = (1 / d) *\<^sub>R x + ((d - 1) / d) *\<^sub>R x"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3500
      by (metis \<open>0 < d\<close> add.commute add_divide_distrib diff_add_cancel divide_self_if less_irrefl scaleR_add_left scaleR_one)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3501
    ultimately show "y \<in> closed_segment x (x + d *\<^sub>R (y - x))"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3502
      apply (auto simp: in_segment)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3503
      apply (rule_tac x="1/d" in exI)
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  3504
      apply (auto simp: algebra_simps)
70620
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3505
      done
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3506
  next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3507
    show "open_segment x (x + d *\<^sub>R (y - x)) \<subseteq> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3508
      apply (rule rel_interior_closure_convex_segment [OF \<open>convex S\<close> x])
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3509
      using df rel_frontier_def by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3510
  qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3511
qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3512
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3513
lemma segment_to_rel_frontier:
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3514
  fixes x :: "'a::euclidean_space"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3515
  assumes S: "convex S" "bounded S" and x: "x \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3516
      and y: "y \<in> S" and xy: "\<not>(x = y \<and> S = {x})"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3517
  obtains z where "z \<in> rel_frontier S" "y \<in> closed_segment x z"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3518
                  "open_segment x z \<subseteq> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3519
proof (cases "x=y")
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3520
  case True
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3521
  with xy have "S \<noteq> {x}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3522
    by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3523
  with True show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3524
    by (metis Set.set_insert all_not_in_conv ends_in_segment(1) insert_iff segment_to_rel_frontier_aux[OF S x] that y)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3525
next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3526
  case False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3527
  then show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3528
    using segment_to_rel_frontier_aux [OF S x y] that by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3529
qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3530
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3531
proposition rel_frontier_not_sing:
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3532
  fixes a :: "'a::euclidean_space"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3533
  assumes "bounded S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3534
    shows "rel_frontier S \<noteq> {a}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3535
proof (cases "S = {}")
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3536
  case True  then show ?thesis  by simp
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3537
next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3538
  case False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3539
  then obtain z where "z \<in> S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3540
    by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3541
  then show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3542
  proof (cases "S = {z}")
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3543
    case True then show ?thesis  by simp
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3544
  next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3545
    case False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3546
    then obtain w where "w \<in> S" "w \<noteq> z"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3547
      using \<open>z \<in> S\<close> by blast
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3548
    show ?thesis
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3549
    proof
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3550
      assume "rel_frontier S = {a}"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3551
      then consider "w \<notin> rel_frontier S" | "z \<notin> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3552
        using \<open>w \<noteq> z\<close> by auto
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3553
      then show False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3554
      proof cases
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3555
        case 1
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3556
        then have w: "w \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3557
          using \<open>w \<in> S\<close> closure_subset rel_frontier_def by fastforce
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3558
        have "w + (w - z) \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3559
          by (metis \<open>w \<in> S\<close> \<open>z \<in> S\<close> affine_affine_hull hull_inc mem_affine_3_minus scaleR_one)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3560
        then obtain e where "0 < e" "(w + e *\<^sub>R (w - z)) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3561
          using \<open>w \<noteq> z\<close>  \<open>z \<in> S\<close> by (metis assms ray_to_rel_frontier right_minus_eq w)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3562
        moreover obtain d where "0 < d" "(w + d *\<^sub>R (z - w)) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3563
          using ray_to_rel_frontier [OF \<open>bounded S\<close> w, of "1 *\<^sub>R (z - w)"]  \<open>w \<noteq> z\<close>  \<open>z \<in> S\<close>
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3564
          by (metis add.commute add.right_neutral diff_add_cancel hull_inc scaleR_one)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3565
        ultimately have "d *\<^sub>R (z - w) = e *\<^sub>R (w - z)"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3566
          using \<open>rel_frontier S = {a}\<close> by force
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3567
        moreover have "e \<noteq> -d "
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3568
          using \<open>0 < e\<close> \<open>0 < d\<close> by force
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3569
        ultimately show False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3570
          by (metis (no_types, lifting) \<open>w \<noteq> z\<close> eq_iff_diff_eq_0 minus_diff_eq real_vector.scale_cancel_right real_vector.scale_minus_right scaleR_left.minus)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3571
      next
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3572
        case 2
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3573
        then have z: "z \<in> rel_interior S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3574
          using \<open>z \<in> S\<close> closure_subset rel_frontier_def by fastforce
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3575
        have "z + (z - w) \<in> affine hull S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3576
          by (metis \<open>z \<in> S\<close> \<open>w \<in> S\<close> affine_affine_hull hull_inc mem_affine_3_minus scaleR_one)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3577
        then obtain e where "0 < e" "(z + e *\<^sub>R (z - w)) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3578
          using \<open>w \<noteq> z\<close>  \<open>w \<in> S\<close> by (metis assms ray_to_rel_frontier right_minus_eq z)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3579
        moreover obtain d where "0 < d" "(z + d *\<^sub>R (w - z)) \<in> rel_frontier S"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3580
          using ray_to_rel_frontier [OF \<open>bounded S\<close> z, of "1 *\<^sub>R (w - z)"]  \<open>w \<noteq> z\<close>  \<open>w \<in> S\<close>
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3581
          by (metis add.commute add.right_neutral diff_add_cancel hull_inc scaleR_one)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3582
        ultimately have "d *\<^sub>R (w - z) = e *\<^sub>R (z - w)"
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3583
          using \<open>rel_frontier S = {a}\<close> by force
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3584
        moreover have "e \<noteq> -d "
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3585
          using \<open>0 < e\<close> \<open>0 < d\<close> by force
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3586
        ultimately show False
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3587
          by (metis (no_types, lifting) \<open>w \<noteq> z\<close> eq_iff_diff_eq_0 minus_diff_eq real_vector.scale_cancel_right real_vector.scale_minus_right scaleR_left.minus)
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3588
      qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3589
    qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3590
  qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3591
qed
f95193669ad7 removed Brouwer_Fixpoint from imports of Derivative
immler
parents: 70138
diff changeset
  3592
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3593
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  3594
subsection\<^marker>\<open>tag unimportant\<close> \<open>Convexity on direct sums\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3595
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3596
lemma closure_sum:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3597
  fixes S T :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3598
  shows "closure S + closure T \<subseteq> closure (S + T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3599
  unfolding set_plus_image closure_Times [symmetric] split_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3600
  by (intro closure_bounded_linear_image_subset bounded_linear_add
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3601
    bounded_linear_fst bounded_linear_snd)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3602
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3603
lemma rel_interior_sum:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3604
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3605
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3606
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3607
  shows "rel_interior (S + T) = rel_interior S + rel_interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3608
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3609
  have "rel_interior S + rel_interior T = (\<lambda>(x,y). x + y) ` (rel_interior S \<times> rel_interior T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3610
    by (simp add: set_plus_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3611
  also have "\<dots> = (\<lambda>(x,y). x + y) ` rel_interior (S \<times> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3612
    using rel_interior_Times assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3613
  also have "\<dots> = rel_interior (S + T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3614
    using fst_snd_linear convex_Times assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3615
      rel_interior_convex_linear_image[of "(\<lambda>(x,y). x + y)" "S \<times> T"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3616
    by (auto simp add: set_plus_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3617
  finally show ?thesis ..
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3618
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3619
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3620
lemma rel_interior_sum_gen:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3621
  fixes S :: "'a \<Rightarrow> 'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3622
  assumes "\<forall>i\<in>I. convex (S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3623
  shows "rel_interior (sum S I) = sum (\<lambda>i. rel_interior (S i)) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3624
  apply (subst sum_set_cond_linear[of convex])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3625
  using rel_interior_sum rel_interior_sing[of "0"] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3626
  apply (auto simp add: convex_set_plus)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3627
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3628
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3629
lemma convex_rel_open_direct_sum:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3630
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3631
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3632
    and "rel_open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3633
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3634
    and "rel_open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3635
  shows "convex (S \<times> T) \<and> rel_open (S \<times> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3636
  by (metis assms convex_Times rel_interior_Times rel_open_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3637
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3638
lemma convex_rel_open_sum:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3639
  fixes S T :: "'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3640
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3641
    and "rel_open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3642
    and "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3643
    and "rel_open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3644
  shows "convex (S + T) \<and> rel_open (S + T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3645
  by (metis assms convex_set_plus rel_interior_sum rel_open_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3646
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3647
lemma convex_hull_finite_union_cones:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3648
  assumes "finite I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3649
    and "I \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3650
  assumes "\<forall>i\<in>I. convex (S i) \<and> cone (S i) \<and> S i \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3651
  shows "convex hull (\<Union>(S ` I)) = sum S I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3652
  (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3653
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3654
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3655
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3656
    assume "x \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3657
    then obtain c xs where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3658
      x: "x = sum (\<lambda>i. c i *\<^sub>R xs i) I \<and> (\<forall>i\<in>I. c i \<ge> 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. xs i \<in> S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3659
      using convex_hull_finite_union[of I S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3660
    define s where "s i = c i *\<^sub>R xs i" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3661
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3662
      fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3663
      assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3664
      then have "s i \<in> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3665
        using s_def x assms mem_cone[of "S i" "xs i" "c i"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3666
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3667
    then have "\<forall>i\<in>I. s i \<in> S i" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3668
    moreover have "x = sum s I" using x s_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3669
    ultimately have "x \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3670
      using set_sum_alt[of I S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3671
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3672
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3673
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3674
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3675
    assume "x \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3676
    then obtain s where x: "x = sum s I \<and> (\<forall>i\<in>I. s i \<in> S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3677
      using set_sum_alt[of I S] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3678
    define xs where "xs i = of_nat(card I) *\<^sub>R s i" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3679
    then have "x = sum (\<lambda>i. ((1 :: real) / of_nat(card I)) *\<^sub>R xs i) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3680
      using x assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3681
    moreover have "\<forall>i\<in>I. xs i \<in> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3682
      using x xs_def assms by (simp add: cone_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3683
    moreover have "\<forall>i\<in>I. (1 :: real) / of_nat (card I) \<ge> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3684
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3685
    moreover have "sum (\<lambda>i. (1 :: real) / of_nat (card I)) I = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3686
      using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3687
    ultimately have "x \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3688
      apply (subst convex_hull_finite_union[of I S])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3689
      using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3690
      apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3691
      using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3692
      apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3693
      apply rule
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3694
      apply (rule_tac x = "(\<lambda>i. (1 :: real) / of_nat (card I))" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3695
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3696
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3697
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3698
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3699
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3700
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3701
lemma convex_hull_union_cones_two:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3702
  fixes S T :: "'m::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3703
  assumes "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3704
    and "cone S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3705
    and "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3706
  assumes "convex T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3707
    and "cone T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3708
    and "T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3709
  shows "convex hull (S \<union> T) = S + T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3710
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3711
  define I :: "nat set" where "I = {1, 2}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3712
  define A where "A i = (if i = (1::nat) then S else T)" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3713
  have "\<Union>(A ` I) = S \<union> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3714
    using A_def I_def by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3715
  then have "convex hull (\<Union>(A ` I)) = convex hull (S \<union> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3716
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3717
  moreover have "convex hull \<Union>(A ` I) = sum A I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3718
    apply (subst convex_hull_finite_union_cones[of I A])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3719
    using assms A_def I_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3720
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3721
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3722
  moreover have "sum A I = S + T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3723
    using A_def I_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3724
    unfolding set_plus_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3725
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3726
    unfolding set_plus_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3727
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3728
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3729
  ultimately show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3730
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3731
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3732
lemma rel_interior_convex_hull_union:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3733
  fixes S :: "'a \<Rightarrow> 'n::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3734
  assumes "finite I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3735
    and "\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3736
  shows "rel_interior (convex hull (\<Union>(S ` I))) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3737
    {sum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3738
      (\<forall>i\<in>I. s i \<in> rel_interior(S i))}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3739
  (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3740
proof (cases "I = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3741
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3742
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3743
    using convex_hull_empty rel_interior_empty by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3744
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3745
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3746
  define C0 where "C0 = convex hull (\<Union>(S ` I))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3747
  have "\<forall>i\<in>I. C0 \<ge> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3748
    unfolding C0_def using hull_subset[of "\<Union>(S ` I)"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3749
  define K0 where "K0 = cone hull ({1 :: real} \<times> C0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3750
  define K where "K i = cone hull ({1 :: real} \<times> S i)" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3751
  have "\<forall>i\<in>I. K i \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3752
    unfolding K_def using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3753
    by (simp add: cone_hull_empty_iff[symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3754
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3755
    fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3756
    assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3757
    then have "convex (K i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3758
      unfolding K_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3759
      apply (subst convex_cone_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3760
      apply (subst convex_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3761
      using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3762
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3763
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3764
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3765
  then have convK: "\<forall>i\<in>I. convex (K i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3766
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3767
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3768
    fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3769
    assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3770
    then have "K0 \<supseteq> K i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3771
      unfolding K0_def K_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3772
      apply (subst hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3773
      using \<open>\<forall>i\<in>I. C0 \<ge> S i\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3774
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3775
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3776
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3777
  then have "K0 \<supseteq> \<Union>(K ` I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3778
  moreover have "convex K0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3779
    unfolding K0_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3780
    apply (subst convex_cone_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3781
    apply (subst convex_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3782
    unfolding C0_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3783
    using convex_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3784
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3785
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3786
  ultimately have geq: "K0 \<supseteq> convex hull (\<Union>(K ` I))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3787
    using hull_minimal[of _ "K0" "convex"] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3788
  have "\<forall>i\<in>I. K i \<supseteq> {1 :: real} \<times> S i"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3789
    using K_def by (simp add: hull_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3790
  then have "\<Union>(K ` I) \<supseteq> {1 :: real} \<times> \<Union>(S ` I)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3791
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3792
  then have "convex hull \<Union>(K ` I) \<supseteq> convex hull ({1 :: real} \<times> \<Union>(S ` I))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3793
    by (simp add: hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3794
  then have "convex hull \<Union>(K ` I) \<supseteq> {1 :: real} \<times> C0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3795
    unfolding C0_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3796
    using convex_hull_Times[of "{(1 :: real)}" "\<Union>(S ` I)"] convex_hull_singleton
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3797
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3798
  moreover have "cone (convex hull (\<Union>(K ` I)))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3799
    apply (subst cone_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3800
    using cone_Union[of "K ` I"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3801
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3802
    unfolding K_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3803
    using cone_cone_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3804
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3805
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3806
  ultimately have "convex hull (\<Union>(K ` I)) \<supseteq> K0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3807
    unfolding K0_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3808
    using hull_minimal[of _ "convex hull (\<Union>(K ` I))" "cone"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3809
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3810
  then have "K0 = convex hull (\<Union>(K ` I))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3811
    using geq by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3812
  also have "\<dots> = sum K I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3813
    apply (subst convex_hull_finite_union_cones[of I K])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3814
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3815
    apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3816
    using False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3817
    apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3818
    unfolding K_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3819
    apply rule
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3820
    apply (subst convex_cone_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3821
    apply (subst convex_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3822
    using assms cone_cone_hull \<open>\<forall>i\<in>I. K i \<noteq> {}\<close> K_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3823
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3824
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3825
  finally have "K0 = sum K I" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3826
  then have *: "rel_interior K0 = sum (\<lambda>i. (rel_interior (K i))) I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3827
    using rel_interior_sum_gen[of I K] convK by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3828
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3829
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3830
    assume "x \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3831
    then have "(1::real, x) \<in> rel_interior K0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3832
      using K0_def C0_def rel_interior_convex_cone_aux[of C0 "1::real" x] convex_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3833
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3834
    then obtain k where k: "(1::real, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3835
      using \<open>finite I\<close> * set_sum_alt[of I "\<lambda>i. rel_interior (K i)"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3836
    {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3837
      fix i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3838
      assume "i \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3839
      then have "convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3840
        using k K_def assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3841
      then have "\<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3842
        using rel_interior_convex_cone[of "S i"] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3843
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3844
    then obtain c s where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3845
      cs: "\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3846
      by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3847
    then have "x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3848
      using k by (simp add: sum_prod)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3849
    then have "x \<in> ?rhs"
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  3850
      using k cs by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3851
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3852
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3853
  {
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3854
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3855
    assume "x \<in> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3856
    then obtain c s where cs: "x = sum (\<lambda>i. c i *\<^sub>R s i) I \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3857
        (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3858
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3859
    define k where "k i = (c i, c i *\<^sub>R s i)" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3860
    {
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67443
diff changeset
  3861
      fix i assume "i \<in> I"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3862
      then have "k i \<in> rel_interior (K i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3863
        using k_def K_def assms cs rel_interior_convex_cone[of "S i"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3864
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3865
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3866
    then have "(1::real, x) \<in> rel_interior K0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3867
      using K0_def * set_sum_alt[of I "(\<lambda>i. rel_interior (K i))"] assms k_def cs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3868
      apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3869
      apply (rule_tac x = k in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3870
      apply (simp add: sum_prod)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3871
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3872
    then have "x \<in> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3873
      using K0_def C0_def rel_interior_convex_cone_aux[of C0 1 x]
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  3874
      by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3875
  }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3876
  ultimately show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3877
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3878
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3879
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3880
lemma convex_le_Inf_differential:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3881
  fixes f :: "real \<Rightarrow> real"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3882
  assumes "convex_on I f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3883
    and "x \<in> interior I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3884
    and "y \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3885
  shows "f y \<ge> f x + Inf ((\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)) * (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3886
  (is "_ \<ge> _ + Inf (?F x) * (y - x)")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3887
proof (cases rule: linorder_cases)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3888
  assume "x < y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3889
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3890
  have "open (interior I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3891
  from openE[OF this \<open>x \<in> interior I\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3892
  obtain e where e: "0 < e" "ball x e \<subseteq> interior I" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3893
  moreover define t where "t = min (x + e / 2) ((x + y) / 2)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3894
  ultimately have "x < t" "t < y" "t \<in> ball x e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3895
    by (auto simp: dist_real_def field_simps split: split_min)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3896
  with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3897
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3898
  have "open (interior I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3899
  from openE[OF this \<open>x \<in> interior I\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3900
  obtain e where "0 < e" "ball x e \<subseteq> interior I" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3901
  moreover define K where "K = x - e / 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3902
  with \<open>0 < e\<close> have "K \<in> ball x e" "K < x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3903
    by (auto simp: dist_real_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3904
  ultimately have "K \<in> I" "K < x" "x \<in> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3905
    using interior_subset[of I] \<open>x \<in> interior I\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3906
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3907
  have "Inf (?F x) \<le> (f x - f y) / (x - y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3908
  proof (intro bdd_belowI cInf_lower2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3909
    show "(f x - f t) / (x - t) \<in> ?F x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3910
      using \<open>t \<in> I\<close> \<open>x < t\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3911
    show "(f x - f t) / (x - t) \<le> (f x - f y) / (x - y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3912
      using \<open>convex_on I f\<close> \<open>x \<in> I\<close> \<open>y \<in> I\<close> \<open>x < t\<close> \<open>t < y\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3913
      by (rule convex_on_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3914
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3915
    fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3916
    assume "y \<in> ?F x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3917
    with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>K \<in> I\<close> _ \<open>K < x\<close> _]]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3918
    show "(f K - f x) / (K - x) \<le> y" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3919
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3920
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3921
    using \<open>x < y\<close> by (simp add: field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3922
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3923
  assume "y < x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3924
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3925
  have "open (interior I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3926
  from openE[OF this \<open>x \<in> interior I\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3927
  obtain e where e: "0 < e" "ball x e \<subseteq> interior I" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3928
  moreover define t where "t = x + e / 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3929
  ultimately have "x < t" "t \<in> ball x e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3930
    by (auto simp: dist_real_def field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3931
  with \<open>x \<in> interior I\<close> e interior_subset[of I] have "t \<in> I" "x \<in> I" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3932
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3933
  have "(f x - f y) / (x - y) \<le> Inf (?F x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3934
  proof (rule cInf_greatest)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3935
    have "(f x - f y) / (x - y) = (f y - f x) / (y - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3936
      using \<open>y < x\<close> by (auto simp: field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3937
    also
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3938
    fix z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3939
    assume "z \<in> ?F x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3940
    with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>y \<in> I\<close> _ \<open>y < x\<close>]]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3941
    have "(f y - f x) / (y - x) \<le> z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3942
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3943
    finally show "(f x - f y) / (x - y) \<le> z" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3944
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3945
    have "open (interior I)" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3946
    from openE[OF this \<open>x \<in> interior I\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3947
    obtain e where e: "0 < e" "ball x e \<subseteq> interior I" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3948
    then have "x + e / 2 \<in> ball x e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3949
      by (auto simp: dist_real_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3950
    with e interior_subset[of I] have "x + e / 2 \<in> {x<..} \<inter> I"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3951
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3952
    then show "?F x \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3953
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3954
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3955
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3956
    using \<open>y < x\<close> by (simp add: field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3957
qed simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3958
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  3959
subsection\<^marker>\<open>tag unimportant\<close>\<open>Explicit formulas for interior and relative interior of convex hull\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3960
66765
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3961
lemma at_within_cbox_finite:
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3962
  assumes "x \<in> box a b" "x \<notin> S" "finite S"
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3963
  shows "(at x within cbox a b - S) = at x"
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3964
proof -
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3965
  have "interior (cbox a b - S) = box a b - S"
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3966
    using \<open>finite S\<close> by (simp add: interior_diff finite_imp_closed)
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3967
  then show ?thesis
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3968
    using at_within_interior assms by fastforce
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3969
qed
c1dfa973b269 new theorem at_within_cbox_finite
paulson <lp15@cam.ac.uk>
parents: 66641
diff changeset
  3970
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3971
lemma affine_independent_convex_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3972
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  3973
  assumes "\<not> affine_dependent s" "t \<subseteq> s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3974
    shows "convex hull t = affine hull t \<inter> convex hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3975
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3976
  have fin: "finite s" "finite t" using assms aff_independent_finite finite_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3977
    { fix u v x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3978
      assume uv: "sum u t = 1" "\<forall>x\<in>s. 0 \<le> v x" "sum v s = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3979
                 "(\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>v\<in>t. u v *\<^sub>R v)" "x \<in> t"
67443
3abf6a722518 standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents: 67399
diff changeset
  3980
      then have s: "s = (s - t) \<union> t" \<comment> \<open>split into separate cases\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3981
        using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3982
      have [simp]: "(\<Sum>x\<in>t. v x *\<^sub>R x) + (\<Sum>x\<in>s - t. v x *\<^sub>R x) = (\<Sum>x\<in>t. u x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3983
                   "sum v t + sum v (s - t) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3984
        using uv fin s
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3985
        by (auto simp: sum.union_disjoint [symmetric] Un_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3986
      have "(\<Sum>x\<in>s. if x \<in> t then v x - u x else v x) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3987
           "(\<Sum>x\<in>s. (if x \<in> t then v x - u x else v x) *\<^sub>R x) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3988
        using uv fin
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3989
        by (subst s, subst sum.union_disjoint, auto simp: algebra_simps sum_subtractf)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3990
    } note [simp] = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3991
  have "convex hull t \<subseteq> affine hull t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3992
    using convex_hull_subset_affine_hull by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3993
  moreover have "convex hull t \<subseteq> convex hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3994
    using assms hull_mono by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3995
  moreover have "affine hull t \<inter> convex hull s \<subseteq> convex hull t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3996
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3997
    apply (simp add: convex_hull_finite affine_hull_finite fin affine_dependent_explicit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3998
    apply (drule_tac x=s in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  3999
    apply (auto simp: fin)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4000
    apply (rule_tac x=u in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4001
    apply (rename_tac v)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4002
    apply (drule_tac x="\<lambda>x. if x \<in> t then v x - u x else v x" in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4003
    apply (force)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4004
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4005
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4006
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4007
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4008
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4009
lemma affine_independent_span_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4010
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4011
  assumes "\<not> affine_dependent s" "card s = Suc (DIM ('a))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4012
    shows "affine hull s = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4013
proof (cases "s = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4014
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4015
    using assms by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4016
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4017
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4018
    then obtain a t where t: "a \<notin> t" "s = insert a t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4019
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4020
    then have fin: "finite t" using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4021
      by (metis finite_insert aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4022
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4023
    using assms t fin
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4024
      apply (simp add: affine_dependent_iff_dependent affine_hull_insert_span_gen)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4025
      apply (rule subset_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4026
      apply force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4027
      apply (rule Fun.vimage_subsetD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4028
      apply (metis add.commute diff_add_cancel surj_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4029
      apply (rule card_ge_dim_independent)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4030
      apply (auto simp: card_image inj_on_def dim_subset_UNIV)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4031
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4032
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4033
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4034
lemma affine_independent_span_gt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4035
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4036
  assumes ind: "\<not> affine_dependent s" and dim: "DIM ('a) < card s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4037
    shows "affine hull s = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4038
  apply (rule affine_independent_span_eq [OF ind])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4039
  apply (rule antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4040
  using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4041
  apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4042
  apply (metis add_2_eq_Suc' not_less_eq_eq affine_dependent_biggerset aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4043
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4044
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4045
lemma empty_interior_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4046
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4047
  assumes "finite s" and dim: "card s \<le> DIM ('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4048
    shows "interior(affine hull s) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4049
  using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4050
  apply (induct s rule: finite_induct)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4051
  apply (simp_all add:  affine_dependent_iff_dependent affine_hull_insert_span_gen interior_translation)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4052
  apply (rule empty_interior_lowdim)
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  4053
  by (auto simp: Suc_le_lessD card_image_le dual_order.trans intro!: dim_le_card'[THEN le_less_trans])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4054
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4055
lemma empty_interior_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4056
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4057
  assumes "finite s" and dim: "card s \<le> DIM ('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4058
    shows "interior(convex hull s) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4059
  by (metis Diff_empty Diff_eq_empty_iff convex_hull_subset_affine_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4060
            interior_mono empty_interior_affine_hull [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4061
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4062
lemma explicit_subset_rel_interior_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4063
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4064
  shows "finite s
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4065
         \<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> s. 0 < u x \<and> u x < 1) \<and> sum u s = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) s = y}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4066
             \<subseteq> rel_interior (convex hull s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4067
  by (force simp add:  rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=s, simplified])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4068
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4069
lemma explicit_subset_rel_interior_convex_hull_minimal:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4070
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4071
  shows "finite s
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4072
         \<Longrightarrow> {y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> sum u s = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) s = y}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4073
             \<subseteq> rel_interior (convex hull s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4074
  by (force simp add:  rel_interior_convex_hull_union [where S="\<lambda>x. {x}" and I=s, simplified])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4075
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4076
lemma rel_interior_convex_hull_explicit:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4077
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4078
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4079
  shows "rel_interior(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4080
         {y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> sum u s = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) s = y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4081
         (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4082
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4083
  show "?rhs \<le> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4084
    by (simp add: aff_independent_finite explicit_subset_rel_interior_convex_hull_minimal assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4085
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4086
  show "?lhs \<le> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4087
  proof (cases "\<exists>a. s = {a}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4088
    case True then show "?lhs \<le> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4089
      by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4090
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4091
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4092
    have fs: "finite s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4093
      using assms by (simp add: aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4094
    { fix a b and d::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4095
      assume ab: "a \<in> s" "b \<in> s" "a \<noteq> b"
67443
3abf6a722518 standardized towards new-style formal comments: isabelle update_comments;
wenzelm
parents: 67399
diff changeset
  4096
      then have s: "s = (s - {a,b}) \<union> {a,b}" \<comment> \<open>split into separate cases\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4097
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4098
      have "(\<Sum>x\<in>s. if x = a then - d else if x = b then d else 0) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4099
           "(\<Sum>x\<in>s. (if x = a then - d else if x = b then d else 0) *\<^sub>R x) = d *\<^sub>R b - d *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4100
        using ab fs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4101
        by (subst s, subst sum.union_disjoint, auto)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4102
    } note [simp] = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4103
    { fix y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4104
      assume y: "y \<in> convex hull s" "y \<notin> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4105
      { fix u T a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4106
        assume ua: "\<forall>x\<in>s. 0 \<le> u x" "sum u s = 1" "\<not> 0 < u a" "a \<in> s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4107
           and yT: "y = (\<Sum>x\<in>s. u x *\<^sub>R x)" "y \<in> T" "open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4108
           and sb: "T \<inter> affine hull s \<subseteq> {w. \<exists>u. (\<forall>x\<in>s. 0 \<le> u x) \<and> sum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = w}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4109
        have ua0: "u a = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4110
          using ua by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4111
        obtain b where b: "b\<in>s" "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4112
          using ua False by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4113
        obtain e where e: "0 < e" "ball (\<Sum>x\<in>s. u x *\<^sub>R x) e \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4114
          using yT by (auto elim: openE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4115
        with b obtain d where d: "0 < d" "norm(d *\<^sub>R (a-b)) < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4116
          by (auto intro: that [of "e / 2 / norm(a-b)"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4117
        have "(\<Sum>x\<in>s. u x *\<^sub>R x) \<in> affine hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4118
          using yT y by (metis affine_hull_convex_hull hull_redundant_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4119
        then have "(\<Sum>x\<in>s. u x *\<^sub>R x) - d *\<^sub>R (a - b) \<in> affine hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4120
          using ua b by (auto simp: hull_inc intro: mem_affine_3_minus2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4121
        then have "y - d *\<^sub>R (a - b) \<in> T \<inter> affine hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4122
          using d e yT by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4123
        then obtain v where "\<forall>x\<in>s. 0 \<le> v x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4124
                            "sum v s = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4125
                            "(\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x) - d *\<^sub>R (a - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4126
          using subsetD [OF sb] yT
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4127
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4128
        then have False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4129
          using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4130
          apply (simp add: affine_dependent_explicit_finite fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4131
          apply (drule_tac x="\<lambda>x. (v x - u x) - (if x = a then -d else if x = b then d else 0)" in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4132
          using ua b d
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4133
          apply (auto simp: algebra_simps sum_subtractf sum.distrib)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4134
          done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4135
      } note * = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4136
      have "y \<notin> rel_interior (convex hull s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4137
        using y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4138
        apply (simp add: mem_rel_interior affine_hull_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4139
        apply (auto simp: convex_hull_finite [OF fs])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4140
        apply (drule_tac x=u in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4141
        apply (auto intro: *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4142
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4143
    } with rel_interior_subset show "?lhs \<le> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4144
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4145
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4146
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4147
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4148
lemma interior_convex_hull_explicit_minimal:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4149
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4150
  shows
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4151
   "\<not> affine_dependent s
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4152
        ==> interior(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4153
             (if card(s) \<le> DIM('a) then {}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4154
              else {y. \<exists>u. (\<forall>x \<in> s. 0 < u x) \<and> sum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4155
  apply (simp add: aff_independent_finite empty_interior_convex_hull, clarify)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4156
  apply (rule trans [of _ "rel_interior(convex hull s)"])
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4157
  apply (simp add: affine_independent_span_gt rel_interior_interior)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4158
  by (simp add: rel_interior_convex_hull_explicit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4159
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4160
lemma interior_convex_hull_explicit:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4161
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4162
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4163
  shows
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4164
   "interior(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4165
             (if card(s) \<le> DIM('a) then {}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4166
              else {y. \<exists>u. (\<forall>x \<in> s. 0 < u x \<and> u x < 1) \<and> sum u s = 1 \<and> (\<Sum>x\<in>s. u x *\<^sub>R x) = y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4167
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4168
  { fix u :: "'a \<Rightarrow> real" and a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4169
    assume "card Basis < card s" and u: "\<And>x. x\<in>s \<Longrightarrow> 0 < u x" "sum u s = 1" and a: "a \<in> s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4170
    then have cs: "Suc 0 < card s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4171
      by (metis DIM_positive less_trans_Suc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4172
    obtain b where b: "b \<in> s" "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4173
    proof (cases "s \<le> {a}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4174
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4175
      then show thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4176
        using cs subset_singletonD by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4177
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4178
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4179
      then show thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4180
      by (blast intro: that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4181
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4182
    have "u a + u b \<le> sum u {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4183
      using a b by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4184
    also have "... \<le> sum u s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4185
      apply (rule Groups_Big.sum_mono2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4186
      using a b u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4187
      apply (auto simp: less_imp_le aff_independent_finite assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4188
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4189
    finally have "u a < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4190
      using \<open>b \<in> s\<close> u by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4191
  } note [simp] = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4192
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4193
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4194
    apply (auto simp: interior_convex_hull_explicit_minimal)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4195
    apply (rule_tac x=u in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4196
    apply (auto simp: not_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4197
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4198
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4199
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4200
lemma interior_closed_segment_ge2:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4201
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4202
  assumes "2 \<le> DIM('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4203
    shows  "interior(closed_segment a b) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4204
using assms unfolding segment_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4205
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4206
  have "card {a, b} \<le> DIM('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4207
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4208
    by (simp add: card_insert_if linear not_less_eq_eq numeral_2_eq_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4209
  then show "interior (convex hull {a, b}) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4210
    by (metis empty_interior_convex_hull finite.insertI finite.emptyI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4211
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4212
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4213
lemma interior_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4214
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4215
  shows  "interior(open_segment a b) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4216
                 (if 2 \<le> DIM('a) then {} else open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4217
proof (simp add: not_le, intro conjI impI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4218
  assume "2 \<le> DIM('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4219
  then show "interior (open_segment a b) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4220
    apply (simp add: segment_convex_hull open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4221
    apply (metis Diff_subset interior_mono segment_convex_hull subset_empty interior_closed_segment_ge2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4222
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4223
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4224
  assume le2: "DIM('a) < 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4225
  show "interior (open_segment a b) = open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4226
  proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4227
    case True then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4228
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4229
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4230
    with le2 have "affine hull (open_segment a b) = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4231
      apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4232
      apply (rule affine_independent_span_gt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4233
      apply (simp_all add: affine_dependent_def insert_Diff_if)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4234
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4235
    then show "interior (open_segment a b) = open_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4236
      using rel_interior_interior rel_interior_open_segment by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4237
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4238
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4239
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4240
lemma interior_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4241
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4242
  shows "interior(closed_segment a b) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4243
                 (if 2 \<le> DIM('a) then {} else open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4244
proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4245
  case True then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4246
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4247
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4248
  then have "closure (open_segment a b) = closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4249
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4250
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4251
    by (metis (no_types) convex_interior_closure convex_open_segment interior_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4252
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4253
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4254
lemmas interior_segment = interior_closed_segment interior_open_segment
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4255
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4256
lemma closed_segment_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4257
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4258
  shows "closed_segment a b = closed_segment c d \<longleftrightarrow> {a,b} = {c,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4259
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4260
  assume abcd: "closed_segment a b = closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4261
  show "{a,b} = {c,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4262
  proof (cases "a=b \<or> c=d")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4263
    case True with abcd show ?thesis by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4264
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4265
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4266
    then have neq: "a \<noteq> b \<and> c \<noteq> d" by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4267
    have *: "closed_segment c d - {a, b} = rel_interior (closed_segment c d)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4268
      using neq abcd by (metis (no_types) open_segment_def rel_interior_closed_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4269
    have "b \<in> {c, d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4270
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4271
      have "insert b (closed_segment c d) = closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4272
        using abcd by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4273
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4274
        by (metis DiffD2 Diff_insert2 False * insertI1 insert_Diff_if open_segment_def rel_interior_closed_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4275
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4276
    moreover have "a \<in> {c, d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4277
      by (metis Diff_iff False * abcd ends_in_segment(1) insertI1 open_segment_def rel_interior_closed_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4278
    ultimately show "{a, b} = {c, d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4279
      using neq by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4280
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4281
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4282
  assume "{a,b} = {c,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4283
  then show "closed_segment a b = closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4284
    by (simp add: segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4285
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4286
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4287
lemma closed_open_segment_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4288
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4289
  shows "closed_segment a b \<noteq> open_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4290
by (metis DiffE closed_segment_neq_empty closure_closed_segment closure_open_segment ends_in_segment(1) insertI1 open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4291
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4292
lemma open_closed_segment_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4293
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4294
  shows "open_segment a b \<noteq> closed_segment c d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4295
using closed_open_segment_eq by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4296
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4297
lemma open_segment_eq [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4298
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4299
  shows "open_segment a b = open_segment c d \<longleftrightarrow> a = b \<and> c = d \<or> {a,b} = {c,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4300
        (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4301
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4302
  assume abcd: ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4303
  show ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4304
  proof (cases "a=b \<or> c=d")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4305
    case True with abcd show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4306
      using finite_open_segment by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4307
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4308
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4309
    then have a2: "a \<noteq> b \<and> c \<noteq> d" by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4310
    with abcd show ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4311
      unfolding open_segment_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4312
      by (metis (no_types) abcd closed_segment_eq closure_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4313
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4314
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4315
  assume ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4316
  then show ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4317
    by (metis Diff_cancel convex_hull_singleton insert_absorb2 open_segment_def segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4318
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4319
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4320
subsection\<^marker>\<open>tag unimportant\<close>\<open>Similar results for closure and (relative or absolute) frontier\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4321
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4322
lemma closure_convex_hull [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4323
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4324
  shows "compact s ==> closure(convex hull s) = convex hull s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4325
  by (simp add: compact_imp_closed compact_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4326
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4327
lemma rel_frontier_convex_hull_explicit:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4328
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4329
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4330
  shows "rel_frontier(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4331
         {y. \<exists>u. (\<forall>x \<in> s. 0 \<le> u x) \<and> (\<exists>x \<in> s. u x = 0) \<and> sum u s = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) s = y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4332
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4333
  have fs: "finite s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4334
    using assms by (simp add: aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4335
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4336
    apply (simp add: rel_frontier_def finite_imp_compact rel_interior_convex_hull_explicit assms fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4337
    apply (auto simp: convex_hull_finite fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4338
    apply (drule_tac x=u in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4339
    apply (rule_tac x=u in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4340
    apply force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4341
    apply (rename_tac v)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4342
    apply (rule notE [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4343
    apply (simp add: affine_dependent_explicit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4344
    apply (rule_tac x=s in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4345
    apply (auto simp: fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4346
    apply (rule_tac x = "\<lambda>x. u x - v x" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4347
    apply (force simp: sum_subtractf scaleR_diff_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4348
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4349
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4350
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4351
lemma frontier_convex_hull_explicit:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4352
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4353
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4354
  shows "frontier(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4355
         {y. \<exists>u. (\<forall>x \<in> s. 0 \<le> u x) \<and> (DIM ('a) < card s \<longrightarrow> (\<exists>x \<in> s. u x = 0)) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4356
             sum u s = 1 \<and> sum (\<lambda>x. u x *\<^sub>R x) s = y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4357
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4358
  have fs: "finite s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4359
    using assms by (simp add: aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4360
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4361
  proof (cases "DIM ('a) < card s")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4362
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4363
    with assms fs show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4364
      by (simp add: rel_frontier_def frontier_def rel_frontier_convex_hull_explicit [symmetric]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4365
                    interior_convex_hull_explicit_minimal rel_interior_convex_hull_explicit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4366
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4367
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4368
    then have "card s \<le> DIM ('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4369
      by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4370
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4371
      using assms fs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4372
      apply (simp add: frontier_def interior_convex_hull_explicit finite_imp_compact)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4373
      apply (simp add: convex_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4374
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4375
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4376
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4377
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4378
lemma rel_frontier_convex_hull_cases:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4379
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4380
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4381
  shows "rel_frontier(convex hull s) = \<Union>{convex hull (s - {x}) |x. x \<in> s}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4382
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4383
  have fs: "finite s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4384
    using assms by (simp add: aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4385
  { fix u a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4386
  have "\<forall>x\<in>s. 0 \<le> u x \<Longrightarrow> a \<in> s \<Longrightarrow> u a = 0 \<Longrightarrow> sum u s = 1 \<Longrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4387
            \<exists>x v. x \<in> s \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4388
                  (\<forall>x\<in>s - {x}. 0 \<le> v x) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4389
                      sum v (s - {x}) = 1 \<and> (\<Sum>x\<in>s - {x}. v x *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4390
    apply (rule_tac x=a in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4391
    apply (rule_tac x=u in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4392
    apply (simp add: Groups_Big.sum_diff1 fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4393
    done }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4394
  moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4395
  { fix a u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4396
    have "a \<in> s \<Longrightarrow> \<forall>x\<in>s - {a}. 0 \<le> u x \<Longrightarrow> sum u (s - {a}) = 1 \<Longrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4397
            \<exists>v. (\<forall>x\<in>s. 0 \<le> v x) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4398
                 (\<exists>x\<in>s. v x = 0) \<and> sum v s = 1 \<and> (\<Sum>x\<in>s. v x *\<^sub>R x) = (\<Sum>x\<in>s - {a}. u x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4399
    apply (rule_tac x="\<lambda>x. if x = a then 0 else u x" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4400
    apply (auto simp: sum.If_cases Diff_eq if_smult fs)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4401
    done }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4402
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4403
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4404
    apply (simp add: rel_frontier_convex_hull_explicit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4405
    apply (simp add: convex_hull_finite fs Union_SetCompr_eq, auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4406
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4407
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4408
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4409
lemma frontier_convex_hull_eq_rel_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4410
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4411
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4412
  shows "frontier(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4413
           (if card s \<le> DIM ('a) then convex hull s else rel_frontier(convex hull s))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4414
  using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4415
  unfolding rel_frontier_def frontier_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4416
  by (simp add: affine_independent_span_gt rel_interior_interior
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4417
                finite_imp_compact empty_interior_convex_hull aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4418
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4419
lemma frontier_convex_hull_cases:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4420
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4421
  assumes "\<not> affine_dependent s"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4422
  shows "frontier(convex hull s) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4423
           (if card s \<le> DIM ('a) then convex hull s else \<Union>{convex hull (s - {x}) |x. x \<in> s})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4424
by (simp add: assms frontier_convex_hull_eq_rel_frontier rel_frontier_convex_hull_cases)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4425
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4426
lemma in_frontier_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4427
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4428
  assumes "finite s" "card s \<le> Suc (DIM ('a))" "x \<in> s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4429
  shows   "x \<in> frontier(convex hull s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4430
proof (cases "affine_dependent s")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4431
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4432
  with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4433
    apply (auto simp: affine_dependent_def frontier_def finite_imp_compact hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4434
    by (metis card.insert_remove convex_hull_subset_affine_hull empty_interior_affine_hull finite_Diff hull_redundant insert_Diff insert_Diff_single insert_not_empty interior_mono not_less_eq_eq subset_empty)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4435
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4436
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4437
  { assume "card s = Suc (card Basis)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4438
    then have cs: "Suc 0 < card s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4439
      by (simp add: DIM_positive)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4440
    with subset_singletonD have "\<exists>y \<in> s. y \<noteq> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4441
      by (cases "s \<le> {x}") fastforce+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4442
  } note [dest!] = this
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4443
  show ?thesis using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4444
    unfolding frontier_convex_hull_cases [OF False] Union_SetCompr_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4445
    by (auto simp: le_Suc_eq hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4446
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4447
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4448
lemma not_in_interior_convex_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4449
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4450
  assumes "finite s" "card s \<le> Suc (DIM ('a))" "x \<in> s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4451
  shows   "x \<notin> interior(convex hull s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4452
using in_frontier_convex_hull [OF assms]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4453
by (metis Diff_iff frontier_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4454
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4455
lemma interior_convex_hull_eq_empty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4456
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4457
  assumes "card s = Suc (DIM ('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4458
  shows   "interior(convex hull s) = {} \<longleftrightarrow> affine_dependent s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4459
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4460
  { fix a b
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4461
    assume ab: "a \<in> interior (convex hull s)" "b \<in> s" "b \<in> affine hull (s - {b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4462
    then have "interior(affine hull s) = {}" using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4463
      by (metis DIM_positive One_nat_def Suc_mono card.remove card_infinite empty_interior_affine_hull eq_iff hull_redundant insert_Diff not_less zero_le_one)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4464
    then have False using ab
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4465
      by (metis convex_hull_subset_affine_hull equals0D interior_mono subset_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4466
  } then
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4467
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4468
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4469
    apply auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4470
    apply (metis UNIV_I affine_hull_convex_hull affine_hull_empty affine_independent_span_eq convex_convex_hull empty_iff rel_interior_interior rel_interior_same_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4471
    apply (auto simp: affine_dependent_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4472
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4473
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4474
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4475
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4476
subsection \<open>Coplanarity, and collinearity in terms of affine hull\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4477
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4478
definition\<^marker>\<open>tag important\<close> coplanar  where
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4479
   "coplanar s \<equiv> \<exists>u v w. s \<subseteq> affine hull {u,v,w}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4480
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4481
lemma collinear_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4482
  "collinear s \<longleftrightarrow> (\<exists>u v. s \<subseteq> affine hull {u,v})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4483
proof (cases "s={}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4484
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4485
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4486
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4487
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4488
  then obtain x where x: "x \<in> s" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4489
  { fix u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4490
    assume *: "\<And>x y. \<lbrakk>x\<in>s; y\<in>s\<rbrakk> \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R u"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4491
    have "\<exists>u v. s \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4492
      apply (rule_tac x=x in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4493
      apply (rule_tac x="x+u" in exI, clarify)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4494
      apply (erule exE [OF * [OF x]])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4495
      apply (rename_tac c)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4496
      apply (rule_tac x="1+c" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4497
      apply (rule_tac x="-c" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4498
      apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4499
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4500
  } moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4501
  { fix u v x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4502
    assume *: "s \<subseteq> {a *\<^sub>R u + b *\<^sub>R v |a b. a + b = 1}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4503
    have "x\<in>s \<Longrightarrow> y\<in>s \<Longrightarrow> \<exists>c. x - y = c *\<^sub>R (v-u)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4504
      apply (drule subsetD [OF *])+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4505
      apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4506
      apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4507
      apply (rename_tac r1 r2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4508
      apply (rule_tac x="r1-r2" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4509
      apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4510
      apply (metis scaleR_left.add)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4511
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4512
  } ultimately
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4513
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4514
  unfolding collinear_def affine_hull_2
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4515
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4516
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4517
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4518
lemma collinear_closed_segment [simp]: "collinear (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4519
by (metis affine_hull_convex_hull collinear_affine_hull hull_subset segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4520
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4521
lemma collinear_open_segment [simp]: "collinear (open_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4522
  unfolding open_segment_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4523
  by (metis convex_hull_subset_affine_hull segment_convex_hull dual_order.trans
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4524
    convex_hull_subset_affine_hull Diff_subset collinear_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4525
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4526
lemma collinear_between_cases:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4527
  fixes c :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4528
  shows "collinear {a,b,c} \<longleftrightarrow> between (b,c) a \<or> between (c,a) b \<or> between (a,b) c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4529
         (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4530
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4531
  assume ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4532
  then obtain u v where uv: "\<And>x. x \<in> {a, b, c} \<Longrightarrow> \<exists>c. x = u + c *\<^sub>R v"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4533
    by (auto simp: collinear_alt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4534
  show ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4535
    using uv [of a] uv [of b] uv [of c] by (auto simp: between_1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4536
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4537
  assume ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4538
  then show ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4539
    unfolding between_mem_convex_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4540
    by (metis (no_types, hide_lams) collinear_closed_segment collinear_subset hull_redundant hull_subset insert_commute segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4541
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4542
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4543
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4544
lemma subset_continuous_image_segment_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4545
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4546
  assumes "continuous_on (closed_segment a b) f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4547
  shows "closed_segment (f a) (f b) \<subseteq> image f (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4548
by (metis connected_segment convex_contains_segment ends_in_segment imageI
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4549
           is_interval_connected_1 is_interval_convex connected_continuous_image [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4550
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4551
lemma continuous_injective_image_segment_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4552
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4553
  assumes contf: "continuous_on (closed_segment a b) f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4554
      and injf: "inj_on f (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4555
  shows "f ` (closed_segment a b) = closed_segment (f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4556
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4557
  show "closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4558
    by (metis subset_continuous_image_segment_1 contf)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4559
  show "f ` closed_segment a b \<subseteq> closed_segment (f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4560
  proof (cases "a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4561
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4562
    then show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4563
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4564
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4565
    then have fnot: "f a \<noteq> f b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4566
      using inj_onD injf by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4567
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4568
    have "f a \<notin> open_segment (f c) (f b)" if c: "c \<in> closed_segment a b" for c
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4569
    proof (clarsimp simp add: open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4570
      assume fa: "f a \<in> closed_segment (f c) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4571
      moreover have "closed_segment (f c) (f b) \<subseteq> f ` closed_segment c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4572
        by (meson closed_segment_subset contf continuous_on_subset convex_closed_segment ends_in_segment(2) subset_continuous_image_segment_1 that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4573
      ultimately have "f a \<in> f ` closed_segment c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4574
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4575
      then have a: "a \<in> closed_segment c b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4576
        by (meson ends_in_segment inj_on_image_mem_iff_alt injf subset_closed_segment that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4577
      have cb: "closed_segment c b \<subseteq> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4578
        by (simp add: closed_segment_subset that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4579
      show "f a = f c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4580
      proof (rule between_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4581
        show "between (f c, f b) (f a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4582
          by (simp add: between_mem_segment fa)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4583
        show "between (f a, f b) (f c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4584
          by (metis a cb between_antisym between_mem_segment between_triv1 subset_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4585
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4586
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4587
    moreover
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4588
    have "f b \<notin> open_segment (f a) (f c)" if c: "c \<in> closed_segment a b" for c
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4589
    proof (clarsimp simp add: open_segment_def fnot eq_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4590
      assume fb: "f b \<in> closed_segment (f a) (f c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4591
      moreover have "closed_segment (f a) (f c) \<subseteq> f ` closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4592
        by (meson contf continuous_on_subset ends_in_segment(1) subset_closed_segment subset_continuous_image_segment_1 that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4593
      ultimately have "f b \<in> f ` closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4594
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4595
      then have b: "b \<in> closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4596
        by (meson ends_in_segment inj_on_image_mem_iff_alt injf subset_closed_segment that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4597
      have ca: "closed_segment a c \<subseteq> closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4598
        by (simp add: closed_segment_subset that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4599
      show "f b = f c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4600
      proof (rule between_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4601
        show "between (f c, f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4602
          by (simp add: between_commute between_mem_segment fb)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4603
        show "between (f b, f a) (f c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4604
          by (metis b between_antisym between_commute between_mem_segment between_triv2 that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4605
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4606
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4607
    ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4608
      by (force simp: closed_segment_eq_real_ivl open_segment_eq_real_ivl split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4609
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4610
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4611
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4612
lemma continuous_injective_image_open_segment_1:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4613
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4614
  assumes contf: "continuous_on (closed_segment a b) f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4615
      and injf: "inj_on f (closed_segment a b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4616
    shows "f ` (open_segment a b) = open_segment (f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4617
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4618
  have "f ` (open_segment a b) = f ` (closed_segment a b) - {f a, f b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4619
    by (metis (no_types, hide_lams) empty_subsetI ends_in_segment image_insert image_is_empty inj_on_image_set_diff injf insert_subset open_segment_def segment_open_subset_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4620
  also have "... = open_segment (f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4621
    using continuous_injective_image_segment_1 [OF assms]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4622
    by (simp add: open_segment_def inj_on_image_set_diff [OF injf])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4623
  finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4624
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4625
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4626
lemma collinear_imp_coplanar:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4627
  "collinear s ==> coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4628
by (metis collinear_affine_hull coplanar_def insert_absorb2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4629
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4630
lemma collinear_small:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4631
  assumes "finite s" "card s \<le> 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4632
    shows "collinear s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4633
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4634
  have "card s = 0 \<or> card s = 1 \<or> card s = 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4635
    using assms by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4636
  then show ?thesis using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4637
    using card_eq_SucD
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4638
    by auto (metis collinear_2 numeral_2_eq_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4639
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4640
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4641
lemma coplanar_small:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4642
  assumes "finite s" "card s \<le> 3"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4643
    shows "coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4644
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4645
  have "card s \<le> 2 \<or> card s = Suc (Suc (Suc 0))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4646
    using assms by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4647
  then show ?thesis using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4648
    apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4649
    apply (simp add: collinear_small collinear_imp_coplanar)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4650
    apply (safe dest!: card_eq_SucD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4651
    apply (auto simp: coplanar_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4652
    apply (metis hull_subset insert_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4653
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4654
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4655
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4656
lemma coplanar_empty: "coplanar {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4657
  by (simp add: coplanar_small)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4658
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4659
lemma coplanar_sing: "coplanar {a}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4660
  by (simp add: coplanar_small)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4661
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4662
lemma coplanar_2: "coplanar {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4663
  by (auto simp: card_insert_if coplanar_small)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4664
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4665
lemma coplanar_3: "coplanar {a,b,c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4666
  by (auto simp: card_insert_if coplanar_small)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4667
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4668
lemma collinear_affine_hull_collinear: "collinear(affine hull s) \<longleftrightarrow> collinear s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4669
  unfolding collinear_affine_hull
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4670
  by (metis affine_affine_hull subset_hull hull_hull hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4671
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4672
lemma coplanar_affine_hull_coplanar: "coplanar(affine hull s) \<longleftrightarrow> coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4673
  unfolding coplanar_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4674
  by (metis affine_affine_hull subset_hull hull_hull hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4675
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4676
lemma coplanar_linear_image:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4677
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4678
  assumes "coplanar s" "linear f" shows "coplanar(f ` s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4679
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4680
  { fix u v w
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4681
    assume "s \<subseteq> affine hull {u, v, w}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4682
    then have "f ` s \<subseteq> f ` (affine hull {u, v, w})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4683
      by (simp add: image_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4684
    then have "f ` s \<subseteq> affine hull (f ` {u, v, w})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4685
      by (metis assms(2) linear_conv_bounded_linear affine_hull_linear_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4686
  } then
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4687
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4688
    by auto (meson assms(1) coplanar_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4689
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4690
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4691
lemma coplanar_translation_imp: "coplanar s \<Longrightarrow> coplanar ((\<lambda>x. a + x) ` s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4692
  unfolding coplanar_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4693
  apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4694
  apply (rule_tac x="u+a" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4695
  apply (rule_tac x="v+a" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4696
  apply (rule_tac x="w+a" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4697
  using affine_hull_translation [of a "{u,v,w}" for u v w]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4698
  apply (force simp: add.commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4699
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4700
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4701
lemma coplanar_translation_eq: "coplanar((\<lambda>x. a + x) ` s) \<longleftrightarrow> coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4702
    by (metis (no_types) coplanar_translation_imp translation_galois)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4703
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4704
lemma coplanar_linear_image_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4705
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4706
  assumes "linear f" "inj f" shows "coplanar(f ` s) = coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4707
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4708
  assume "coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4709
  then show "coplanar (f ` s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4710
    unfolding coplanar_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4711
    using affine_hull_linear_image [of f "{u,v,w}" for u v w]  assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4712
    by (meson coplanar_def coplanar_linear_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4713
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4714
  obtain g where g: "linear g" "g \<circ> f = id"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4715
    using linear_injective_left_inverse [OF assms]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4716
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4717
  assume "coplanar (f ` s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4718
  then obtain u v w where "f ` s \<subseteq> affine hull {u, v, w}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4719
    by (auto simp: coplanar_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4720
  then have "g ` f ` s \<subseteq> g ` (affine hull {u, v, w})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4721
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4722
  then have "s \<subseteq> g ` (affine hull {u, v, w})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4723
    using g by (simp add: Fun.image_comp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4724
  then show "coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4725
    unfolding coplanar_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4726
    using affine_hull_linear_image [of g "{u,v,w}" for u v w]  \<open>linear g\<close> linear_conv_bounded_linear
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4727
    by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4728
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4729
(*The HOL Light proof is simply
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4730
    MATCH_ACCEPT_TAC(LINEAR_INVARIANT_RULE COPLANAR_LINEAR_IMAGE));;
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4731
*)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4732
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4733
lemma coplanar_subset: "\<lbrakk>coplanar t; s \<subseteq> t\<rbrakk> \<Longrightarrow> coplanar s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4734
  by (meson coplanar_def order_trans)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4735
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4736
lemma affine_hull_3_imp_collinear: "c \<in> affine hull {a,b} \<Longrightarrow> collinear {a,b,c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4737
  by (metis collinear_2 collinear_affine_hull_collinear hull_redundant insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4738
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4739
lemma collinear_3_imp_in_affine_hull: "\<lbrakk>collinear {a,b,c}; a \<noteq> b\<rbrakk> \<Longrightarrow> c \<in> affine hull {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4740
  unfolding collinear_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4741
  apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4742
  apply (frule_tac x=b in bspec, blast, drule_tac x=a in bspec, blast, erule exE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4743
  apply (drule_tac x=c in bspec, blast, drule_tac x=a in bspec, blast, erule exE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4744
  apply (rename_tac y x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4745
  apply (simp add: affine_hull_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4746
  apply (rule_tac x="1 - x/y" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4747
  apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4748
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4749
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4750
lemma collinear_3_affine_hull:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4751
  assumes "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4752
    shows "collinear {a,b,c} \<longleftrightarrow> c \<in> affine hull {a,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4753
using affine_hull_3_imp_collinear assms collinear_3_imp_in_affine_hull by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4754
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4755
lemma collinear_3_eq_affine_dependent:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4756
  "collinear{a,b,c} \<longleftrightarrow> a = b \<or> a = c \<or> b = c \<or> affine_dependent {a,b,c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4757
apply (case_tac "a=b", simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4758
apply (case_tac "a=c")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4759
apply (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4760
apply (case_tac "b=c")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4761
apply (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4762
apply (auto simp: affine_dependent_def collinear_3_affine_hull insert_Diff_if)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4763
apply (metis collinear_3_affine_hull insert_commute)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4764
done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4765
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4766
lemma affine_dependent_imp_collinear_3:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4767
  "affine_dependent {a,b,c} \<Longrightarrow> collinear{a,b,c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4768
by (simp add: collinear_3_eq_affine_dependent)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4769
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4770
lemma collinear_3: "NO_MATCH 0 x \<Longrightarrow> collinear {x,y,z} \<longleftrightarrow> collinear {0, x-y, z-y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4771
  by (auto simp add: collinear_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4772
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4773
lemma collinear_3_expand:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4774
   "collinear{a,b,c} \<longleftrightarrow> a = c \<or> (\<exists>u. b = u *\<^sub>R a + (1 - u) *\<^sub>R c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4775
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4776
  have "collinear{a,b,c} = collinear{a,c,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4777
    by (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4778
  also have "... = collinear {0, a - c, b - c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4779
    by (simp add: collinear_3)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4780
  also have "... \<longleftrightarrow> (a = c \<or> b = c \<or> (\<exists>ca. b - c = ca *\<^sub>R (a - c)))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4781
    by (simp add: collinear_lemma)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4782
  also have "... \<longleftrightarrow> a = c \<or> (\<exists>u. b = u *\<^sub>R a + (1 - u) *\<^sub>R c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4783
    by (cases "a = c \<or> b = c") (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4784
  finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4785
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4786
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4787
lemma collinear_aff_dim: "collinear S \<longleftrightarrow> aff_dim S \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4788
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4789
  assume "collinear S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4790
  then obtain u and v :: "'a" where "aff_dim S \<le> aff_dim {u,v}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4791
    by (metis \<open>collinear S\<close> aff_dim_affine_hull aff_dim_subset collinear_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4792
  then show "aff_dim S \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4793
    using order_trans by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4794
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4795
  assume "aff_dim S \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4796
  then have le1: "aff_dim (affine hull S) \<le> 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4797
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4798
  obtain B where "B \<subseteq> S" and B: "\<not> affine_dependent B" "affine hull S = affine hull B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4799
    using affine_basis_exists [of S] by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4800
  then have "finite B" "card B \<le> 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4801
    using B le1 by (auto simp: affine_independent_iff_card)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4802
  then have "collinear B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4803
    by (rule collinear_small)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4804
  then show "collinear S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4805
    by (metis \<open>affine hull S = affine hull B\<close> collinear_affine_hull_collinear)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4806
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4807
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4808
lemma collinear_midpoint: "collinear{a,midpoint a b,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4809
  apply (auto simp: collinear_3 collinear_lemma)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4810
  apply (drule_tac x="-1" in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4811
  apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4812
  done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4813
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4814
lemma midpoint_collinear:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4815
  fixes a b c :: "'a::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4816
  assumes "a \<noteq> c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4817
    shows "b = midpoint a c \<longleftrightarrow> collinear{a,b,c} \<and> dist a b = dist b c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4818
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4819
  have *: "a - (u *\<^sub>R a + (1 - u) *\<^sub>R c) = (1 - u) *\<^sub>R (a - c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4820
          "u *\<^sub>R a + (1 - u) *\<^sub>R c - c = u *\<^sub>R (a - c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4821
          "\<bar>1 - u\<bar> = \<bar>u\<bar> \<longleftrightarrow> u = 1/2" for u::real
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4822
    by (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4823
  have "b = midpoint a c \<Longrightarrow> collinear{a,b,c} "
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4824
    using collinear_midpoint by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4825
  moreover have "collinear{a,b,c} \<Longrightarrow> b = midpoint a c \<longleftrightarrow> dist a b = dist b c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4826
    apply (auto simp: collinear_3_expand assms dist_midpoint)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4827
    apply (simp add: dist_norm * assms midpoint_def del: divide_const_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4828
    apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4829
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4830
  ultimately show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4831
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4832
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4833
lemma between_imp_collinear:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4834
  fixes x :: "'a :: euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4835
  assumes "between (a,b) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4836
    shows "collinear {a,x,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4837
proof (cases "x = a \<or> x = b \<or> a = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4838
  case True with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4839
    by (auto simp: dist_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4840
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4841
  case False with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4842
    apply (auto simp: collinear_3 collinear_lemma between_norm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4843
    apply (drule_tac x="-(norm(b - x) / norm(x - a))" in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4844
    apply (simp add: vector_add_divide_simps eq_vector_fraction_iff real_vector.scale_minus_right [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4845
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4846
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4847
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4848
lemma midpoint_between:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4849
  fixes a b :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4850
  shows "b = midpoint a c \<longleftrightarrow> between (a,c) b \<and> dist a b = dist b c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4851
proof (cases "a = c")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4852
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4853
    by (auto simp: dist_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4854
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4855
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4856
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4857
    apply (rule iffI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4858
    apply (simp add: between_midpoint(1) dist_midpoint)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4859
    using False between_imp_collinear midpoint_collinear by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4860
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4861
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4862
lemma collinear_triples:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4863
  assumes "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4864
    shows "collinear(insert a (insert b S)) \<longleftrightarrow> (\<forall>x \<in> S. collinear{a,b,x})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4865
          (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4866
proof safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4867
  fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4868
  assume ?lhs and "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4869
  then show "collinear {a, b, x}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4870
    using collinear_subset by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4871
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4872
  assume ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4873
  then have "\<forall>x \<in> S. collinear{a,x,b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4874
    by (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4875
  then have *: "\<exists>u. x = u *\<^sub>R a + (1 - u) *\<^sub>R b" if "x \<in> (insert a (insert b S))" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4876
    using that assms collinear_3_expand by fastforce+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4877
  show ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4878
    unfolding collinear_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4879
    apply (rule_tac x="b-a" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4880
    apply (clarify dest!: *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4881
    by (metis (no_types, hide_lams) add.commute diff_add_cancel diff_diff_eq2 real_vector.scale_right_diff_distrib scaleR_left.diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4882
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4883
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4884
lemma collinear_4_3:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4885
  assumes "a \<noteq> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4886
    shows "collinear {a,b,c,d} \<longleftrightarrow> collinear{a,b,c} \<and> collinear{a,b,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4887
  using collinear_triples [OF assms, of "{c,d}"] by (force simp:)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4888
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4889
lemma collinear_3_trans:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4890
  assumes "collinear{a,b,c}" "collinear{b,c,d}" "b \<noteq> c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4891
    shows "collinear{a,b,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4892
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4893
  have "collinear{b,c,a,d}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4894
    by (metis (full_types) assms collinear_4_3 insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4895
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4896
    by (simp add: collinear_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4897
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4898
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4899
lemma affine_hull_eq_empty [simp]: "affine hull S = {} \<longleftrightarrow> S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4900
  using affine_hull_nonempty by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4901
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4902
lemma affine_hull_2_alt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4903
  fixes a b :: "'a::real_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4904
  shows "affine hull {a,b} = range (\<lambda>u. a + u *\<^sub>R (b - a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4905
apply (simp add: affine_hull_2, safe)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4906
apply (rule_tac x=v in image_eqI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4907
apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4908
apply (metis scaleR_add_left scaleR_one, simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4909
apply (rule_tac x="1-u" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4910
apply (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4911
done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4912
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4913
lemma interior_convex_hull_3_minimal:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4914
  fixes a :: "'a::euclidean_space"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  4915
  shows "\<lbrakk>\<not> collinear{a,b,c}; DIM('a) = 2\<rbrakk>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4916
         \<Longrightarrow> interior(convex hull {a,b,c}) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4917
                {v. \<exists>x y z. 0 < x \<and> 0 < y \<and> 0 < z \<and> x + y + z = 1 \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4918
                            x *\<^sub>R a + y *\<^sub>R b + z *\<^sub>R c = v}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4919
apply (simp add: collinear_3_eq_affine_dependent interior_convex_hull_explicit_minimal, safe)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4920
apply (rule_tac x="u a" in exI, simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4921
apply (rule_tac x="u b" in exI, simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4922
apply (rule_tac x="u c" in exI, simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4923
apply (rename_tac uu x y z)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4924
apply (rule_tac x="\<lambda>r. (if r=a then x else if r=b then y else if r=c then z else 0)" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4925
apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4926
done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4927
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  4928
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4929
subsection\<^marker>\<open>tag unimportant\<close>\<open>Basic lemmas about hyperplanes and halfspaces\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4930
69516
09bb8f470959 most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
immler
parents: 69508
diff changeset
  4931
lemma halfspace_Int_eq:
09bb8f470959 most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
immler
parents: 69508
diff changeset
  4932
     "{x. a \<bullet> x \<le> b} \<inter> {x. b \<le> a \<bullet> x} = {x. a \<bullet> x = b}"
09bb8f470959 most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
immler
parents: 69508
diff changeset
  4933
     "{x. b \<le> a \<bullet> x} \<inter> {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
09bb8f470959 most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
immler
parents: 69508
diff changeset
  4934
  by auto
09bb8f470959 most of Topology_Euclidean_Space (now Elementary_Topology) requires fewer dependencies
immler
parents: 69508
diff changeset
  4935
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4936
lemma hyperplane_eq_Ex:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4937
  assumes "a \<noteq> 0" obtains x where "a \<bullet> x = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4938
  by (rule_tac x = "(b / (a \<bullet> a)) *\<^sub>R a" in that) (simp add: assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4939
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4940
lemma hyperplane_eq_empty:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4941
     "{x. a \<bullet> x = b} = {} \<longleftrightarrow> a = 0 \<and> b \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4942
  using hyperplane_eq_Ex apply auto[1]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4943
  using inner_zero_right by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4944
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4945
lemma hyperplane_eq_UNIV:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4946
   "{x. a \<bullet> x = b} = UNIV \<longleftrightarrow> a = 0 \<and> b = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4947
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4948
  have "UNIV \<subseteq> {x. a \<bullet> x = b} \<Longrightarrow> a = 0 \<and> b = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4949
    apply (drule_tac c = "((b+1) / (a \<bullet> a)) *\<^sub>R a" in subsetD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4950
    apply simp_all
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4951
    by (metis add_cancel_right_right zero_neq_one)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4952
  then show ?thesis by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4953
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4954
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4955
lemma halfspace_eq_empty_lt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4956
   "{x. a \<bullet> x < b} = {} \<longleftrightarrow> a = 0 \<and> b \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4957
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4958
  have "{x. a \<bullet> x < b} \<subseteq> {} \<Longrightarrow> a = 0 \<and> b \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4959
    apply (rule ccontr)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4960
    apply (drule_tac c = "((b-1) / (a \<bullet> a)) *\<^sub>R a" in subsetD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4961
    apply force+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4962
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4963
  then show ?thesis by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4964
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4965
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4966
lemma halfspace_eq_empty_gt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4967
   "{x. a \<bullet> x > b} = {} \<longleftrightarrow> a = 0 \<and> b \<ge> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4968
using halfspace_eq_empty_lt [of "-a" "-b"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4969
by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4970
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4971
lemma halfspace_eq_empty_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4972
   "{x. a \<bullet> x \<le> b} = {} \<longleftrightarrow> a = 0 \<and> b < 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4973
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4974
  have "{x. a \<bullet> x \<le> b} \<subseteq> {} \<Longrightarrow> a = 0 \<and> b < 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4975
    apply (rule ccontr)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4976
    apply (drule_tac c = "((b-1) / (a \<bullet> a)) *\<^sub>R a" in subsetD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4977
    apply force+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4978
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4979
  then show ?thesis by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4980
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4981
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4982
lemma halfspace_eq_empty_ge:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4983
   "{x. a \<bullet> x \<ge> b} = {} \<longleftrightarrow> a = 0 \<and> b > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4984
using halfspace_eq_empty_le [of "-a" "-b"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4985
by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4986
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4987
subsection\<^marker>\<open>tag unimportant\<close>\<open>Use set distance for an easy proof of separation properties\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4988
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  4989
proposition\<^marker>\<open>tag unimportant\<close> separation_closures:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4990
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4991
  assumes "S \<inter> closure T = {}" "T \<inter> closure S = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4992
  obtains U V where "U \<inter> V = {}" "open U" "open V" "S \<subseteq> U" "T \<subseteq> V"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4993
proof (cases "S = {} \<or> T = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4994
  case True with that show ?thesis by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4995
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4996
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4997
  define f where "f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4998
  have contf: "continuous_on UNIV f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  4999
    unfolding f_def by (intro continuous_intros continuous_on_setdist)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5000
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5001
  proof (rule_tac U = "{x. f x > 0}" and V = "{x. f x < 0}" in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5002
    show "{x. 0 < f x} \<inter> {x. f x < 0} = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5003
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5004
    show "open {x. 0 < f x}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5005
      by (simp add: open_Collect_less contf continuous_on_const)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5006
    show "open {x. f x < 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5007
      by (simp add: open_Collect_less contf continuous_on_const)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5008
    show "S \<subseteq> {x. 0 < f x}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5009
      apply (clarsimp simp add: f_def setdist_sing_in_set)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5010
      using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5011
      by (metis False IntI empty_iff le_less setdist_eq_0_sing_2 setdist_pos_le setdist_sym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5012
    show "T \<subseteq> {x. f x < 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5013
      apply (clarsimp simp add: f_def setdist_sing_in_set)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5014
      using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5015
      by (metis False IntI empty_iff le_less setdist_eq_0_sing_2 setdist_pos_le setdist_sym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5016
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5017
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5018
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5019
lemma separation_normal:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5020
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5021
  assumes "closed S" "closed T" "S \<inter> T = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5022
  obtains U V where "open U" "open V" "S \<subseteq> U" "T \<subseteq> V" "U \<inter> V = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5023
using separation_closures [of S T]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5024
by (metis assms closure_closed disjnt_def inf_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5025
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5026
lemma separation_normal_local:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5027
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5028
  assumes US: "closedin (top_of_set U) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5029
      and UT: "closedin (top_of_set U) T"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5030
      and "S \<inter> T = {}"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5031
  obtains S' T' where "openin (top_of_set U) S'"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5032
                      "openin (top_of_set U) T'"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5033
                      "S \<subseteq> S'"  "T \<subseteq> T'"  "S' \<inter> T' = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5034
proof (cases "S = {} \<or> T = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5035
  case True with that show ?thesis
68056
9e077a905209 cleaned up more messy proofs
paulson <lp15@cam.ac.uk>
parents: 67990
diff changeset
  5036
    using UT US by (blast dest: closedin_subset)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5037
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5038
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5039
  define f where "f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5040
  have contf: "continuous_on U f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5041
    unfolding f_def by (intro continuous_intros)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5042
  show ?thesis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5043
  proof (rule_tac S' = "(U \<inter> f -` {0<..})" and T' = "(U \<inter> f -` {..<0})" in that)
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5044
    show "(U \<inter> f -` {0<..}) \<inter> (U \<inter> f -` {..<0}) = {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5045
      by auto
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5046
    show "openin (top_of_set U) (U \<inter> f -` {0<..})"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5047
      by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf)
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5048
  next
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5049
    show "openin (top_of_set U) (U \<inter> f -` {..<0})"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5050
      by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5051
  next
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5052
    have "S \<subseteq> U" "T \<subseteq> U"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5053
      using closedin_imp_subset assms by blast+
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5054
    then show "S \<subseteq> U \<inter> f -` {0<..}" "T \<subseteq> U \<inter> f -` {..<0}"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5055
      using assms False by (force simp add: f_def setdist_sing_in_set intro!: setdist_gt_0_closedin)+
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5056
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5057
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5058
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5059
lemma separation_normal_compact:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5060
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5061
  assumes "compact S" "closed T" "S \<inter> T = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5062
  obtains U V where "open U" "compact(closure U)" "open V" "S \<subseteq> U" "T \<subseteq> V" "U \<inter> V = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5063
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5064
  have "closed S" "bounded S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5065
    using assms by (auto simp: compact_eq_bounded_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5066
  then obtain r where "r>0" and r: "S \<subseteq> ball 0 r"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5067
    by (auto dest!: bounded_subset_ballD)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5068
  have **: "closed (T \<union> - ball 0 r)" "S \<inter> (T \<union> - ball 0 r) = {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5069
    using assms r by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5070
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5071
    apply (rule separation_normal [OF \<open>closed S\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5072
    apply (rule_tac U=U and V=V in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5073
    by auto (meson bounded_ball bounded_subset compl_le_swap2 disjoint_eq_subset_Compl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5074
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5075
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5076
subsection\<open>Connectedness of the intersection of a chain\<close>
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5077
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  5078
proposition connected_chain:
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5079
  fixes \<F> :: "'a :: euclidean_space set set"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5080
  assumes cc: "\<And>S. S \<in> \<F> \<Longrightarrow> compact S \<and> connected S"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5081
      and linear: "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5082
  shows "connected(\<Inter>\<F>)"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  5083
proof (cases "\<F> = {}")
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5084
  case True then show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5085
    by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5086
next
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5087
  case False
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5088
  then have cf: "compact(\<Inter>\<F>)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5089
    by (simp add: cc compact_Inter)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5090
  have False if AB: "closed A" "closed B" "A \<inter> B = {}"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5091
                and ABeq: "A \<union> B = \<Inter>\<F>" and "A \<noteq> {}" "B \<noteq> {}" for A B
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5092
  proof -
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5093
    obtain U V where "open U" "open V" "A \<subseteq> U" "B \<subseteq> V" "U \<inter> V = {}"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5094
      using separation_normal [OF AB] by metis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5095
    obtain K where "K \<in> \<F>" "compact K"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5096
      using cc False by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5097
    then obtain N where "open N" and "K \<subseteq> N"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5098
      by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5099
    let ?\<C> = "insert (U \<union> V) ((\<lambda>S. N - S) ` \<F>)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5100
    obtain \<D> where "\<D> \<subseteq> ?\<C>" "finite \<D>" "K \<subseteq> \<Union>\<D>"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5101
    proof (rule compactE [OF \<open>compact K\<close>])
69745
aec42cee2521 more canonical and less specialized syntax
nipkow
parents: 69712
diff changeset
  5102
      show "K \<subseteq> \<Union>(insert (U \<union> V) ((-) N ` \<F>))"
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5103
        using \<open>K \<subseteq> N\<close> ABeq \<open>A \<subseteq> U\<close> \<open>B \<subseteq> V\<close> by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5104
      show "\<And>B. B \<in> insert (U \<union> V) ((-) N ` \<F>) \<Longrightarrow> open B"
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5105
        by (auto simp:  \<open>open U\<close> \<open>open V\<close> open_Un \<open>open N\<close> cc compact_imp_closed open_Diff)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5106
    qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5107
    then have "finite(\<D> - {U \<union> V})"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5108
      by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5109
    moreover have "\<D> - {U \<union> V} \<subseteq> (\<lambda>S. N - S) ` \<F>"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5110
      using \<open>\<D> \<subseteq> ?\<C>\<close> by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5111
    ultimately obtain \<G> where "\<G> \<subseteq> \<F>" "finite \<G>" and Deq: "\<D> - {U \<union> V} = (\<lambda>S. N-S) ` \<G>"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5112
      using finite_subset_image by metis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5113
    obtain J where "J \<in> \<F>" and J: "(\<Union>S\<in>\<G>. N - S) \<subseteq> N - J"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5114
    proof (cases "\<G> = {}")
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5115
      case True
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5116
      with \<open>\<F> \<noteq> {}\<close> that show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5117
        by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5118
    next
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5119
      case False
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5120
      have "\<And>S T. \<lbrakk>S \<in> \<G>; T \<in> \<G>\<rbrakk> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5121
        by (meson \<open>\<G> \<subseteq> \<F>\<close> in_mono local.linear)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5122
      with \<open>finite \<G>\<close> \<open>\<G> \<noteq> {}\<close>
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5123
      have "\<exists>J \<in> \<G>. (\<Union>S\<in>\<G>. N - S) \<subseteq> N - J"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5124
      proof induction
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5125
        case (insert X \<H>)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5126
        show ?case
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5127
        proof (cases "\<H> = {}")
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5128
          case True then show ?thesis by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5129
        next
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5130
          case False
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5131
          then have "\<And>S T. \<lbrakk>S \<in> \<H>; T \<in> \<H>\<rbrakk> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5132
            by (simp add: insert.prems)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5133
          with insert.IH False obtain J where "J \<in> \<H>" and J: "(\<Union>Y\<in>\<H>. N - Y) \<subseteq> N - J"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5134
            by metis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5135
          have "N - J \<subseteq> N - X \<or> N - X \<subseteq> N - J"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5136
            by (meson Diff_mono \<open>J \<in> \<H>\<close> insert.prems(2) insert_iff order_refl)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5137
          then show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5138
          proof
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5139
            assume "N - J \<subseteq> N - X" with J show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5140
              by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5141
          next
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5142
            assume "N - X \<subseteq> N - J"
69325
4b6ddc5989fc removed legacy input syntax
haftmann
parents: 69313
diff changeset
  5143
            with J have "N - X \<union> \<Union> ((-) N ` \<H>) \<subseteq> N - J"
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5144
              by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5145
            with \<open>J \<in> \<H>\<close> show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5146
              by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5147
          qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5148
        qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5149
      qed simp
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5150
      with \<open>\<G> \<subseteq> \<F>\<close> show ?thesis by (blast intro: that)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5151
    qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5152
    have "K \<subseteq> \<Union>(insert (U \<union> V) (\<D> - {U \<union> V}))"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5153
      using \<open>K \<subseteq> \<Union>\<D>\<close> by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5154
    also have "... \<subseteq> (U \<union> V) \<union> (N - J)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5155
      by (metis (no_types, hide_lams) Deq Un_subset_iff Un_upper2 J Union_insert order_trans sup_ge1)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5156
    finally have "J \<inter> K \<subseteq> U \<union> V"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5157
      by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5158
    moreover have "connected(J \<inter> K)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5159
      by (metis Int_absorb1 \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> cc inf.orderE local.linear)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5160
    moreover have "U \<inter> (J \<inter> K) \<noteq> {}"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5161
      using ABeq \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> \<open>A \<noteq> {}\<close> \<open>A \<subseteq> U\<close> by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5162
    moreover have "V \<inter> (J \<inter> K) \<noteq> {}"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5163
      using ABeq \<open>J \<in> \<F>\<close> \<open>K \<in> \<F>\<close> \<open>B \<noteq> {}\<close> \<open>B \<subseteq> V\<close> by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5164
    ultimately show False
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5165
        using connectedD [of "J \<inter> K" U V] \<open>open U\<close> \<open>open V\<close> \<open>U \<inter> V = {}\<close>  by auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5166
  qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5167
  with cf show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5168
    by (auto simp: connected_closed_set compact_imp_closed)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5169
qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5170
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5171
lemma connected_chain_gen:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5172
  fixes \<F> :: "'a :: euclidean_space set set"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5173
  assumes X: "X \<in> \<F>" "compact X"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5174
      and cc: "\<And>T. T \<in> \<F> \<Longrightarrow> closed T \<and> connected T"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5175
      and linear: "\<And>S T. S \<in> \<F> \<and> T \<in> \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5176
  shows "connected(\<Inter>\<F>)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5177
proof -
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5178
  have "\<Inter>\<F> = (\<Inter>T\<in>\<F>. X \<inter> T)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5179
    using X by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5180
  moreover have "connected (\<Inter>T\<in>\<F>. X \<inter> T)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5181
  proof (rule connected_chain)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5182
    show "\<And>T. T \<in> (\<inter>) X ` \<F> \<Longrightarrow> compact T \<and> connected T"
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5183
      using cc X by auto (metis inf.absorb2 inf.orderE local.linear)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5184
    show "\<And>S T. S \<in> (\<inter>) X ` \<F> \<and> T \<in> (\<inter>) X ` \<F> \<Longrightarrow> S \<subseteq> T \<or> T \<subseteq> S"
66793
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5185
      using local.linear by blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5186
  qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5187
  ultimately show ?thesis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5188
    by metis
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5189
qed
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5190
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5191
lemma connected_nest:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5192
  fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5193
  assumes S: "\<And>n. compact(S n)" "\<And>n. connected(S n)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5194
    and nest: "\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5195
  shows "connected(\<Inter> (range S))"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5196
  apply (rule connected_chain)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5197
  using S apply blast
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5198
  by (metis image_iff le_cases nest)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5199
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5200
lemma connected_nest_gen:
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5201
  fixes S :: "'a::linorder \<Rightarrow> 'b::euclidean_space set"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5202
  assumes S: "\<And>n. closed(S n)" "\<And>n. connected(S n)" "compact(S k)"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5203
    and nest: "\<And>m n. m \<le> n \<Longrightarrow> S n \<subseteq> S m"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5204
  shows "connected(\<Inter> (range S))"
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5205
  apply (rule connected_chain_gen [of "S k"])
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5206
  using S apply auto
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5207
  by (meson le_cases nest subsetCE)
deabce3ccf1f new material about connectedness, etc.
paulson <lp15@cam.ac.uk>
parents: 66765
diff changeset
  5208
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5209
subsection\<open>Proper maps, including projections out of compact sets\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5210
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5211
lemma finite_indexed_bound:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5212
  assumes A: "finite A" "\<And>x. x \<in> A \<Longrightarrow> \<exists>n::'a::linorder. P x n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5213
    shows "\<exists>m. \<forall>x \<in> A. \<exists>k\<le>m. P x k"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5214
using A
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5215
proof (induction A)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5216
  case empty then show ?case by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5217
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5218
  case (insert a A)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5219
    then obtain m n where "\<forall>x \<in> A. \<exists>k\<le>m. P x k" "P a n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5220
      by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5221
    then show ?case
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5222
      apply (rule_tac x="max m n" in exI, safe)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5223
      using max.cobounded2 apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5224
      by (meson le_max_iff_disj)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5225
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5226
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  5227
proposition proper_map:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5228
  fixes f :: "'a::heine_borel \<Rightarrow> 'b::heine_borel"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5229
  assumes "closedin (top_of_set S) K"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5230
      and com: "\<And>U. \<lbrakk>U \<subseteq> T; compact U\<rbrakk> \<Longrightarrow> compact (S \<inter> f -` U)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5231
      and "f ` S \<subseteq> T"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5232
    shows "closedin (top_of_set T) (f ` K)"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  5233
proof -
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5234
  have "K \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5235
    using assms closedin_imp_subset by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5236
  obtain C where "closed C" and Keq: "K = S \<inter> C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5237
    using assms by (auto simp: closedin_closed)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5238
  have *: "y \<in> f ` K" if "y \<in> T" and y: "y islimpt f ` K" for y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5239
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5240
    obtain h where "\<forall>n. (\<exists>x\<in>K. h n = f x) \<and> h n \<noteq> y" "inj h" and hlim: "(h \<longlongrightarrow> y) sequentially"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5241
      using \<open>y \<in> T\<close> y by (force simp: limpt_sequential_inj)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5242
    then obtain X where X: "\<And>n. X n \<in> K \<and> h n = f (X n) \<and> h n \<noteq> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5243
      by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5244
    then have fX: "\<And>n. f (X n) = h n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5245
      by metis
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5246
    have "compact (C \<inter> (S \<inter> f -` insert y (range (\<lambda>i. f(X(n + i))))))" for n
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5247
      apply (rule closed_Int_compact [OF \<open>closed C\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5248
      apply (rule com)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5249
       using X \<open>K \<subseteq> S\<close> \<open>f ` S \<subseteq> T\<close> \<open>y \<in> T\<close> apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5250
      apply (rule compact_sequence_with_limit)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5251
      apply (simp add: fX add.commute [of n] LIMSEQ_ignore_initial_segment [OF hlim])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5252
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5253
    then have comf: "compact {a \<in> K. f a \<in> insert y (range (\<lambda>i. f(X(n + i))))}" for n
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5254
      by (simp add: Keq Int_def conj_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5255
    have ne: "\<Inter>\<F> \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5256
             if "finite \<F>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5257
                and \<F>: "\<And>t. t \<in> \<F> \<Longrightarrow>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5258
                           (\<exists>n. t = {a \<in> K. f a \<in> insert y (range (\<lambda>i. f (X (n + i))))})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5259
             for \<F>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5260
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5261
      obtain m where m: "\<And>t. t \<in> \<F> \<Longrightarrow> \<exists>k\<le>m. t = {a \<in> K. f a \<in> insert y (range (\<lambda>i. f (X (k + i))))}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5262
        apply (rule exE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5263
        apply (rule finite_indexed_bound [OF \<open>finite \<F>\<close> \<F>], assumption, force)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5264
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5265
      have "X m \<in> \<Inter>\<F>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5266
        using X le_Suc_ex by (fastforce dest: m)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5267
      then show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5268
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5269
    have "\<Inter>{{a. a \<in> K \<and> f a \<in> insert y (range (\<lambda>i. f(X(n + i))))} |n. n \<in> UNIV}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5270
               \<noteq> {}"
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69518
diff changeset
  5271
      apply (rule compact_fip_Heine_Borel)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5272
       using comf apply force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5273
      using ne  apply (simp add: subset_iff del: insert_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5274
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5275
    then have "\<exists>x. x \<in> (\<Inter>n. {a \<in> K. f a \<in> insert y (range (\<lambda>i. f (X (n + i))))})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5276
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5277
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5278
      apply (simp add: image_iff fX)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5279
      by (metis \<open>inj h\<close> le_add1 not_less_eq_eq rangeI range_ex1_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5280
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5281
  with assms closedin_subset show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5282
    by (force simp: closedin_limpt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5283
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5284
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5285
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5286
lemma compact_continuous_image_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5287
  fixes f :: "'a::heine_borel \<Rightarrow> 'b::heine_borel"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5288
  assumes f: "inj_on f S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5289
  shows "continuous_on S f \<longleftrightarrow> (\<forall>T. compact T \<and> T \<subseteq> S \<longrightarrow> compact(f ` T))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5290
           (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5291
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5292
  assume ?lhs then show ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5293
    by (metis continuous_on_subset compact_continuous_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5294
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5295
  assume RHS: ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5296
  obtain g where gf: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5297
    by (metis inv_into_f_f f)
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5298
  then have *: "(S \<inter> f -` U) = g ` U" if "U \<subseteq> f ` S" for U
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5299
    using that by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5300
  have gfim: "g ` f ` S \<subseteq> S" using gf by auto
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5301
  have **: "compact (f ` S \<inter> g -` C)" if C: "C \<subseteq> S" "compact C" for C
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5302
  proof -
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5303
    obtain h where "h C \<in> C \<and> h C \<notin> S \<or> compact (f ` C)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5304
      by (force simp: C RHS)
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5305
    moreover have "f ` C = (f ` S \<inter> g -` C)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5306
      using C gf by auto
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5307
    ultimately show ?thesis
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5308
      using C by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5309
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5310
  show ?lhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5311
    using proper_map [OF _ _ gfim] **
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5312
    by (simp add: continuous_on_closed * closedin_imp_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5313
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5314
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5315
subsection\<^marker>\<open>tag unimportant\<close>\<open>Trivial fact: convexity equals connectedness for collinear sets\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5316
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5317
lemma convex_connected_collinear:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5318
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5319
  assumes "collinear S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5320
    shows "convex S \<longleftrightarrow> connected S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5321
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5322
  assume "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5323
  then show "connected S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5324
    using convex_connected by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5325
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5326
  assume S: "connected S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5327
  show "convex S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5328
  proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5329
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5330
    then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5331
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5332
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5333
    then obtain a where "a \<in> S" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5334
    have "collinear (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5335
      by (simp add: assms collinear_affine_hull_collinear)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5336
    then obtain z where "z \<noteq> 0" "\<And>x. x \<in> affine hull S \<Longrightarrow> \<exists>c. x - a = c *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5337
      by (meson \<open>a \<in> S\<close> collinear hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5338
    then obtain f where f: "\<And>x. x \<in> affine hull S \<Longrightarrow> x - a = f x *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5339
      by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5340
    then have inj_f: "inj_on f (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5341
      by (metis diff_add_cancel inj_onI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5342
    have diff: "x - y = (f x - f y) *\<^sub>R z" if x: "x \<in> affine hull S" and y: "y \<in> affine hull S" for x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5343
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5344
      have "f x *\<^sub>R z = x - a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5345
        by (simp add: f hull_inc x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5346
      moreover have "f y *\<^sub>R z = y - a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5347
        by (simp add: f hull_inc y)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5348
      ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5349
        by (simp add: scaleR_left.diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5350
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5351
    have cont_f: "continuous_on (affine hull S) f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5352
      apply (clarsimp simp: dist_norm continuous_on_iff diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5353
      by (metis \<open>z \<noteq> 0\<close> mult.commute mult_less_cancel_left_pos norm_minus_commute real_norm_def zero_less_mult_iff zero_less_norm_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5354
    then have conn_fS: "connected (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5355
      by (meson S connected_continuous_image continuous_on_subset hull_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5356
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5357
    proof (clarsimp simp: convex_contains_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5358
      fix x y z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5359
      assume "x \<in> S" "y \<in> S" "z \<in> closed_segment x y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5360
      have False if "z \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5361
      proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5362
        have "f ` (closed_segment x y) = closed_segment (f x) (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5363
          apply (rule continuous_injective_image_segment_1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5364
          apply (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc continuous_on_subset [OF cont_f])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5365
          by (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc inj_on_subset [OF inj_f])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5366
        then have fz: "f z \<in> closed_segment (f x) (f y)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5367
          using \<open>z \<in> closed_segment x y\<close> by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5368
        have "z \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5369
          by (meson \<open>x \<in> S\<close> \<open>y \<in> S\<close> \<open>z \<in> closed_segment x y\<close> convex_affine_hull convex_contains_segment hull_inc subset_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5370
        then have fz_notin: "f z \<notin> f ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5371
          using hull_subset inj_f inj_onD that by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5372
        moreover have "{..<f z} \<inter> f ` S \<noteq> {}" "{f z<..} \<inter> f ` S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5373
        proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5374
          have "{..<f z} \<inter> f ` {x,y} \<noteq> {}"  "{f z<..} \<inter> f ` {x,y} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5375
            using fz fz_notin \<open>x \<in> S\<close> \<open>y \<in> S\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5376
             apply (auto simp: closed_segment_eq_real_ivl split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5377
             apply (metis image_eqI less_eq_real_def)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5378
            done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5379
          then show "{..<f z} \<inter> f ` S \<noteq> {}" "{f z<..} \<inter> f ` S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5380
            using \<open>x \<in> S\<close> \<open>y \<in> S\<close> by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5381
        qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5382
        ultimately show False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5383
          using connectedD [OF conn_fS, of "{..<f z}" "{f z<..}"] by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5384
      qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5385
      then show "z \<in> S" by meson
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5386
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5387
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5388
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5389
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5390
lemma compact_convex_collinear_segment_alt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5391
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5392
  assumes "S \<noteq> {}" "compact S" "connected S" "collinear S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5393
  obtains a b where "S = closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5394
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5395
  obtain \<xi> where "\<xi> \<in> S" using \<open>S \<noteq> {}\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5396
  have "collinear (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5397
    by (simp add: assms collinear_affine_hull_collinear)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5398
  then obtain z where "z \<noteq> 0" "\<And>x. x \<in> affine hull S \<Longrightarrow> \<exists>c. x - \<xi> = c *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5399
    by (meson \<open>\<xi> \<in> S\<close> collinear hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5400
  then obtain f where f: "\<And>x. x \<in> affine hull S \<Longrightarrow> x - \<xi> = f x *\<^sub>R z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5401
    by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5402
  let ?g = "\<lambda>r. r *\<^sub>R z + \<xi>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5403
  have gf: "?g (f x) = x" if "x \<in> affine hull S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5404
    by (metis diff_add_cancel f that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5405
  then have inj_f: "inj_on f (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5406
    by (metis inj_onI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5407
  have diff: "x - y = (f x - f y) *\<^sub>R z" if x: "x \<in> affine hull S" and y: "y \<in> affine hull S" for x y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5408
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5409
    have "f x *\<^sub>R z = x - \<xi>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5410
      by (simp add: f hull_inc x)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5411
    moreover have "f y *\<^sub>R z = y - \<xi>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5412
      by (simp add: f hull_inc y)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5413
    ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5414
      by (simp add: scaleR_left.diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5415
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5416
  have cont_f: "continuous_on (affine hull S) f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5417
    apply (clarsimp simp: dist_norm continuous_on_iff diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5418
    by (metis \<open>z \<noteq> 0\<close> mult.commute mult_less_cancel_left_pos norm_minus_commute real_norm_def zero_less_mult_iff zero_less_norm_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5419
  then have "connected (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5420
    by (meson \<open>connected S\<close> connected_continuous_image continuous_on_subset hull_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5421
  moreover have "compact (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5422
    by (meson \<open>compact S\<close> compact_continuous_image_eq cont_f hull_subset inj_f)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5423
  ultimately obtain x y where "f ` S = {x..y}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5424
    by (meson connected_compact_interval_1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5425
  then have fS_eq: "f ` S = closed_segment x y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5426
    using \<open>S \<noteq> {}\<close> closed_segment_eq_real_ivl by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5427
  obtain a b where "a \<in> S" "f a = x" "b \<in> S" "f b = y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5428
    by (metis (full_types) ends_in_segment fS_eq imageE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5429
  have "f ` (closed_segment a b) = closed_segment (f a) (f b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5430
    apply (rule continuous_injective_image_segment_1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5431
     apply (meson \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc continuous_on_subset [OF cont_f])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5432
    by (meson \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment hull_inc inj_on_subset [OF inj_f])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5433
  then have "f ` (closed_segment a b) = f ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5434
    by (simp add: \<open>f a = x\<close> \<open>f b = y\<close> fS_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5435
  then have "?g ` f ` (closed_segment a b) = ?g ` f ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5436
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5437
  moreover have "(\<lambda>x. f x *\<^sub>R z + \<xi>) ` closed_segment a b = closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5438
    apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5439
     apply (metis (mono_tags, hide_lams) \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment gf hull_inc subsetCE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5440
    by (metis (mono_tags, lifting) \<open>a \<in> S\<close> \<open>b \<in> S\<close> convex_affine_hull convex_contains_segment gf hull_subset image_iff subsetCE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5441
  ultimately have "closed_segment a b = S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5442
    using gf by (simp add: image_comp o_def hull_inc cong: image_cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5443
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5444
    using that by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5445
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5446
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5447
lemma compact_convex_collinear_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5448
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5449
  assumes "S \<noteq> {}" "compact S" "convex S" "collinear S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5450
  obtains a b where "S = closed_segment a b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5451
  using assms convex_connected_collinear compact_convex_collinear_segment_alt by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5452
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5453
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5454
lemma proper_map_from_compact:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5455
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5456
  assumes contf: "continuous_on S f" and imf: "f ` S \<subseteq> T" and "compact S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5457
          "closedin (top_of_set T) K"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5458
  shows "compact (S \<inter> f -` K)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5459
by (rule closedin_compact [OF \<open>compact S\<close>] continuous_closedin_preimage_gen assms)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5460
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5461
lemma proper_map_fst:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5462
  assumes "compact T" "K \<subseteq> S" "compact K"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5463
    shows "compact (S \<times> T \<inter> fst -` K)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5464
proof -
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5465
  have "(S \<times> T \<inter> fst -` K) = K \<times> T"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5466
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5467
  then show ?thesis by (simp add: assms compact_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5468
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5469
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5470
lemma closed_map_fst:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5471
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5472
  assumes "compact T" "closedin (top_of_set (S \<times> T)) c"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5473
   shows "closedin (top_of_set S) (fst ` c)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5474
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5475
  have *: "fst ` (S \<times> T) \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5476
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5477
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5478
    using proper_map [OF _ _ *] by (simp add: proper_map_fst assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5479
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5480
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5481
lemma proper_map_snd:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5482
  assumes "compact S" "K \<subseteq> T" "compact K"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5483
    shows "compact (S \<times> T \<inter> snd -` K)"
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5484
proof -
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  5485
  have "(S \<times> T \<inter> snd -` K) = S \<times> K"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5486
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5487
  then show ?thesis by (simp add: assms compact_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5488
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5489
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5490
lemma closed_map_snd:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5491
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5492
  assumes "compact S" "closedin (top_of_set (S \<times> T)) c"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5493
   shows "closedin (top_of_set T) (snd ` c)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5494
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5495
  have *: "snd ` (S \<times> T) \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5496
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5497
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5498
    using proper_map [OF _ _ *] by (simp add: proper_map_snd assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5499
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5500
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5501
lemma closedin_compact_projection:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5502
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5503
  assumes "compact S" and clo: "closedin (top_of_set (S \<times> T)) U"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5504
    shows "closedin (top_of_set T) {y. \<exists>x. x \<in> S \<and> (x, y) \<in> U}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5505
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5506
  have "U \<subseteq> S \<times> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5507
    by (metis clo closedin_imp_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5508
  then have "{y. \<exists>x. x \<in> S \<and> (x, y) \<in> U} = snd ` U"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5509
    by force
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5510
  moreover have "closedin (top_of_set T) (snd ` U)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5511
    by (rule closed_map_snd [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5512
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5513
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5514
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5515
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5516
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5517
lemma closed_compact_projection:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5518
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5519
    and T :: "('a * 'b::euclidean_space) set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5520
  assumes "compact S" and clo: "closed T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5521
    shows "closed {y. \<exists>x. x \<in> S \<and> (x, y) \<in> T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5522
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5523
  have *: "{y. \<exists>x. x \<in> S \<and> Pair x y \<in> T} =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5524
        {y. \<exists>x. x \<in> S \<and> Pair x y \<in> ((S \<times> UNIV) \<inter> T)}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5525
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5526
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5527
    apply (subst *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5528
    apply (rule closedin_closed_trans [OF _ closed_UNIV])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5529
    apply (rule closedin_compact_projection [OF \<open>compact S\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5530
    by (simp add: clo closedin_closed_Int)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5531
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5532
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5533
subsubsection\<^marker>\<open>tag unimportant\<close>\<open>Representing affine hull as a finite intersection of hyperplanes\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5534
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5535
proposition\<^marker>\<open>tag unimportant\<close> affine_hull_convex_Int_nonempty_interior:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5536
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5537
  assumes "convex S" "S \<inter> interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5538
    shows "affine hull (S \<inter> T) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5539
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5540
  show "affine hull (S \<inter> T) \<subseteq> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5541
    by (simp add: hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5542
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5543
  obtain a where "a \<in> S" "a \<in> T" and at: "a \<in> interior T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5544
    using assms interior_subset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5545
  then obtain e where "e > 0" and e: "cball a e \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5546
    using mem_interior_cball by blast
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5547
  have *: "x \<in> (+) a ` span ((\<lambda>x. x - a) ` (S \<inter> T))" if "x \<in> S" for x
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5548
  proof (cases "x = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5549
    case True with that span_0 eq_add_iff image_def mem_Collect_eq show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5550
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5551
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5552
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5553
    define k where "k = min (1/2) (e / norm (x-a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5554
    have k: "0 < k" "k < 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5555
      using \<open>e > 0\<close> False by (auto simp: k_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5556
    then have xa: "(x-a) = inverse k *\<^sub>R k *\<^sub>R (x-a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5557
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5558
    have "e / norm (x - a) \<ge> k"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5559
      using k_def by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5560
    then have "a + k *\<^sub>R (x - a) \<in> cball a e"
70802
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70620
diff changeset
  5561
      using \<open>0 < k\<close> False
160eaf566bcb formally augmented corresponding rules for field_simps
haftmann
parents: 70620
diff changeset
  5562
      by (simp add: dist_norm) (simp add: field_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5563
    then have T: "a + k *\<^sub>R (x - a) \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5564
      using e by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5565
    have S: "a + k *\<^sub>R (x - a) \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5566
      using k \<open>a \<in> S\<close> convexD [OF \<open>convex S\<close> \<open>a \<in> S\<close> \<open>x \<in> S\<close>, of "1-k" k]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5567
      by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5568
    have "inverse k *\<^sub>R k *\<^sub>R (x-a) \<in> span ((\<lambda>x. x - a) ` (S \<inter> T))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5569
      apply (rule span_mul)
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  5570
      apply (rule span_base)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5571
      apply (rule image_eqI [where x = "a + k *\<^sub>R (x - a)"])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5572
      apply (auto simp: S T)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5573
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5574
    with xa image_iff show ?thesis  by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5575
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5576
  show "affine hull S \<subseteq> affine hull (S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5577
    apply (simp add: subset_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5578
    apply (simp add: \<open>a \<in> S\<close> \<open>a \<in> T\<close> hull_inc affine_hull_span_gen [of a])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5579
    apply (force simp: *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5580
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5581
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5582
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5583
corollary affine_hull_convex_Int_open:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5584
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5585
  assumes "convex S" "open T" "S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5586
    shows "affine hull (S \<inter> T) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5587
using affine_hull_convex_Int_nonempty_interior assms interior_eq by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5588
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5589
corollary affine_hull_affine_Int_nonempty_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5590
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5591
  assumes "affine S" "S \<inter> interior T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5592
    shows "affine hull (S \<inter> T) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5593
by (simp add: affine_hull_convex_Int_nonempty_interior affine_imp_convex assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5594
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5595
corollary affine_hull_affine_Int_open:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5596
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5597
  assumes "affine S" "open T" "S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5598
    shows "affine hull (S \<inter> T) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5599
by (simp add: affine_hull_convex_Int_open affine_imp_convex assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5600
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5601
corollary affine_hull_convex_Int_openin:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5602
  fixes S :: "'a::real_normed_vector set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5603
  assumes "convex S" "openin (top_of_set (affine hull S)) T" "S \<inter> T \<noteq> {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5604
    shows "affine hull (S \<inter> T) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5605
using assms unfolding openin_open
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5606
by (metis affine_hull_convex_Int_open hull_subset inf.orderE inf_assoc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5607
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5608
corollary affine_hull_openin:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5609
  fixes S :: "'a::real_normed_vector set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5610
  assumes "openin (top_of_set (affine hull T)) S" "S \<noteq> {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5611
    shows "affine hull S = affine hull T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5612
using assms unfolding openin_open
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5613
by (metis affine_affine_hull affine_hull_affine_Int_open hull_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5614
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5615
corollary affine_hull_open:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5616
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5617
  assumes "open S" "S \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5618
    shows "affine hull S = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5619
by (metis affine_hull_convex_Int_nonempty_interior assms convex_UNIV hull_UNIV inf_top.left_neutral interior_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5620
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5621
lemma aff_dim_convex_Int_nonempty_interior:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5622
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5623
  shows "\<lbrakk>convex S; S \<inter> interior T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim(S \<inter> T) = aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5624
using aff_dim_affine_hull2 affine_hull_convex_Int_nonempty_interior by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5625
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5626
lemma aff_dim_convex_Int_open:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5627
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5628
  shows "\<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow>  aff_dim(S \<inter> T) = aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5629
using aff_dim_convex_Int_nonempty_interior interior_eq by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5630
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5631
lemma affine_hull_Diff:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5632
  fixes S:: "'a::real_normed_vector set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5633
  assumes ope: "openin (top_of_set (affine hull S)) S" and "finite F" "F \<subset> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5634
    shows "affine hull (S - F) = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5635
proof -
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  5636
  have clo: "closedin (top_of_set S) F"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5637
    using assms finite_imp_closedin by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5638
  moreover have "S - F \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5639
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5640
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5641
    by (metis ope closedin_def topspace_euclidean_subtopology affine_hull_openin openin_trans)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5642
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5643
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5644
lemma affine_hull_halfspace_lt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5645
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5646
  shows "affine hull {x. a \<bullet> x < r} = (if a = 0 \<and> r \<le> 0 then {} else UNIV)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5647
using halfspace_eq_empty_lt [of a r]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5648
by (simp add: open_halfspace_lt affine_hull_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5649
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5650
lemma affine_hull_halfspace_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5651
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5652
  shows "affine hull {x. a \<bullet> x \<le> r} = (if a = 0 \<and> r < 0 then {} else UNIV)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5653
proof (cases "a = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5654
  case True then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5655
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5656
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5657
  then have "affine hull closure {x. a \<bullet> x < r} = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5658
    using affine_hull_halfspace_lt closure_same_affine_hull by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5659
  moreover have "{x. a \<bullet> x < r} \<subseteq> {x. a \<bullet> x \<le> r}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5660
    by (simp add: Collect_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5661
  ultimately show ?thesis using False antisym_conv hull_mono top_greatest
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5662
    by (metis affine_hull_halfspace_lt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5663
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5664
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5665
lemma affine_hull_halfspace_gt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5666
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5667
  shows "affine hull {x. a \<bullet> x > r} = (if a = 0 \<and> r \<ge> 0 then {} else UNIV)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5668
using halfspace_eq_empty_gt [of r a]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5669
by (simp add: open_halfspace_gt affine_hull_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5670
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5671
lemma affine_hull_halfspace_ge:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5672
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5673
  shows "affine hull {x. a \<bullet> x \<ge> r} = (if a = 0 \<and> r > 0 then {} else UNIV)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5674
using affine_hull_halfspace_le [of "-a" "-r"] by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5675
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5676
lemma aff_dim_halfspace_lt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5677
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5678
  shows "aff_dim {x. a \<bullet> x < r} =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5679
        (if a = 0 \<and> r \<le> 0 then -1 else DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5680
by simp (metis aff_dim_open halfspace_eq_empty_lt open_halfspace_lt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5681
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5682
lemma aff_dim_halfspace_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5683
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5684
  shows "aff_dim {x. a \<bullet> x \<le> r} =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5685
        (if a = 0 \<and> r < 0 then -1 else DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5686
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5687
  have "int (DIM('a)) = aff_dim (UNIV::'a set)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5688
    by (simp add: aff_dim_UNIV)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5689
  then have "aff_dim (affine hull {x. a \<bullet> x \<le> r}) = DIM('a)" if "(a = 0 \<longrightarrow> r \<ge> 0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5690
    using that by (simp add: affine_hull_halfspace_le not_less)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5691
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5692
    by (force simp: aff_dim_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5693
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5694
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5695
lemma aff_dim_halfspace_gt:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5696
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5697
  shows "aff_dim {x. a \<bullet> x > r} =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5698
        (if a = 0 \<and> r \<ge> 0 then -1 else DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5699
by simp (metis aff_dim_open halfspace_eq_empty_gt open_halfspace_gt)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5700
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5701
lemma aff_dim_halfspace_ge:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5702
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5703
  shows "aff_dim {x. a \<bullet> x \<ge> r} =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5704
        (if a = 0 \<and> r > 0 then -1 else DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5705
using aff_dim_halfspace_le [of "-a" "-r"] by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5706
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5707
proposition aff_dim_eq_hyperplane:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5708
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5709
  shows "aff_dim S = DIM('a) - 1 \<longleftrightarrow> (\<exists>a b. a \<noteq> 0 \<and> affine hull S = {x. a \<bullet> x = b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5710
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5711
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5712
    by (auto simp: dest: hyperplane_eq_Ex)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5713
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5714
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5715
  then obtain c where "c \<in> S" by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5716
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5717
  proof (cases "c = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5718
    case True show ?thesis
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5719
      using span_zero [of S]
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5720
        apply (simp add: aff_dim_eq_dim [of c] affine_hull_span_gen [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5721
          del: One_nat_def)
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5722
        apply (auto simp add: \<open>c = 0\<close>)
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5723
        done
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5724
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5725
    case False
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5726
    have xc_im: "x \<in> (+) c ` {y. a \<bullet> y = 0}" if "a \<bullet> x = a \<bullet> c" for a x
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5727
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5728
      have "\<exists>y. a \<bullet> y = 0 \<and> c + y = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5729
        by (metis that add.commute diff_add_cancel inner_commute inner_diff_left right_minus_eq)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5730
      then show "x \<in> (+) c ` {y. a \<bullet> y = 0}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5731
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5732
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5733
    have 2: "span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = 0}"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5734
         if "(+) c ` span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = b}" for a b
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5735
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5736
      have "b = a \<bullet> c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5737
        using span_0 that by fastforce
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5738
      with that have "(+) c ` span ((\<lambda>x. x - c) ` S) = {x. a \<bullet> x = a \<bullet> c}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5739
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5740
      then have "span ((\<lambda>x. x - c) ` S) = (\<lambda>x. x - c) ` {x. a \<bullet> x = a \<bullet> c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5741
        by (metis (no_types) image_cong translation_galois uminus_add_conv_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5742
      also have "... = {x. a \<bullet> x = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5743
        by (force simp: inner_distrib inner_diff_right
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5744
             intro: image_eqI [where x="x+c" for x])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5745
      finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5746
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5747
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5748
      apply (simp add: aff_dim_eq_dim [of c] affine_hull_span_gen [of c] \<open>c \<in> S\<close> hull_inc dim_eq_hyperplane
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5749
                  del: One_nat_def cong: image_cong_simp, safe)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5750
      apply (fastforce simp add: inner_distrib intro: xc_im)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5751
      apply (force simp: intro!: 2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5752
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5753
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5754
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5755
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5756
corollary aff_dim_hyperplane [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5757
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5758
  shows "a \<noteq> 0 \<Longrightarrow> aff_dim {x. a \<bullet> x = r} = DIM('a) - 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5759
by (metis aff_dim_eq_hyperplane affine_hull_eq affine_hyperplane)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5760
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5761
subsection\<^marker>\<open>tag unimportant\<close>\<open>Some stepping theorems\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5762
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5763
lemma aff_dim_insert:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5764
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5765
  shows "aff_dim (insert a S) = (if a \<in> affine hull S then aff_dim S else aff_dim S + 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5766
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5767
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5768
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5769
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5770
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5771
  then obtain x s' where S: "S = insert x s'" "x \<notin> s'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5772
    by (meson Set.set_insert all_not_in_conv)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5773
  show ?thesis using S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5774
    apply (simp add: hull_redundant cong: aff_dim_affine_hull2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5775
    apply (simp add: affine_hull_insert_span_gen hull_inc)
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5776
    by (force simp add: span_zero insert_commute [of a] hull_inc aff_dim_eq_dim [of x] dim_insert
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5777
      cong: image_cong_simp)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5778
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5779
66297
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5780
lemma affine_dependent_choose:
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5781
  fixes a :: "'a :: euclidean_space"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  5782
  assumes "\<not>(affine_dependent S)"
66297
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5783
  shows "affine_dependent(insert a S) \<longleftrightarrow> a \<notin> S \<and> a \<in> affine hull S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5784
        (is "?lhs = ?rhs")
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5785
proof safe
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5786
  assume "affine_dependent (insert a S)" and "a \<in> S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5787
  then show "False"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5788
    using \<open>a \<in> S\<close> assms insert_absorb by fastforce
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5789
next
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5790
  assume lhs: "affine_dependent (insert a S)"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5791
  then have "a \<notin> S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5792
    by (metis (no_types) assms insert_absorb)
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5793
  moreover have "finite S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5794
    using affine_independent_iff_card assms by blast
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5795
  moreover have "aff_dim (insert a S) \<noteq> int (card S)"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5796
    using \<open>finite S\<close> affine_independent_iff_card \<open>a \<notin> S\<close> lhs by fastforce
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5797
  ultimately show "a \<in> affine hull S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5798
    by (metis aff_dim_affine_independent aff_dim_insert assms)
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5799
next
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5800
  assume "a \<notin> S" and "a \<in> affine hull S"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5801
  show "affine_dependent (insert a S)"
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5802
    by (simp add: \<open>a \<in> affine hull S\<close> \<open>a \<notin> S\<close> affine_dependent_def)
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5803
qed
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5804
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5805
lemma affine_independent_insert:
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5806
  fixes a :: "'a :: euclidean_space"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  5807
  shows "\<lbrakk>\<not> affine_dependent S; a \<notin> affine hull S\<rbrakk> \<Longrightarrow> \<not> affine_dependent(insert a S)"
66297
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5808
  by (simp add: affine_dependent_choose)
d425bdf419f5 polytopes: simplical subdivisions, etc.
paulson <lp15@cam.ac.uk>
parents: 66289
diff changeset
  5809
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5810
lemma subspace_bounded_eq_trivial:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5811
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5812
  assumes "subspace S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5813
    shows "bounded S \<longleftrightarrow> S = {0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5814
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5815
  have "False" if "bounded S" "x \<in> S" "x \<noteq> 0" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5816
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5817
    obtain B where B: "\<And>y. y \<in> S \<Longrightarrow> norm y < B" "B > 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5818
      using \<open>bounded S\<close> by (force simp: bounded_pos_less)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5819
    have "(B / norm x) *\<^sub>R x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5820
      using assms subspace_mul \<open>x \<in> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5821
    moreover have "norm ((B / norm x) *\<^sub>R x) = B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5822
      using that B by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5823
    ultimately show False using B by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5824
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5825
  then have "bounded S \<Longrightarrow> S = {0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5826
    using assms subspace_0 by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5827
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5828
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5829
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5830
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5831
lemma affine_bounded_eq_trivial:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5832
  fixes S :: "'a::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5833
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5834
    shows "bounded S \<longleftrightarrow> S = {} \<or> (\<exists>a. S = {a})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5835
proof (cases "S = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5836
  case True then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5837
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5838
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5839
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5840
  then obtain b where "b \<in> S" by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5841
  with False assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5842
    apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5843
    using affine_diffs_subspace [OF assms \<open>b \<in> S\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5844
    apply (metis (no_types, lifting) subspace_bounded_eq_trivial ab_left_minus bounded_translation
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5845
                image_empty image_insert translation_invert)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5846
    apply force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5847
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5848
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5849
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5850
lemma affine_bounded_eq_lowdim:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5851
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5852
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5853
    shows "bounded S \<longleftrightarrow> aff_dim S \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5854
apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5855
using affine_bounded_eq_trivial assms apply fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5856
by (metis aff_dim_sing aff_dim_subset affine_dim_equal affine_sing all_not_in_conv assms bounded_empty bounded_insert dual_order.antisym empty_subsetI insert_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5857
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5858
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5859
lemma bounded_hyperplane_eq_trivial_0:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5860
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5861
  assumes "a \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5862
  shows "bounded {x. a \<bullet> x = 0} \<longleftrightarrow> DIM('a) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5863
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5864
  assume "bounded {x. a \<bullet> x = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5865
  then have "aff_dim {x. a \<bullet> x = 0} \<le> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5866
    by (simp add: affine_bounded_eq_lowdim affine_hyperplane)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5867
  with assms show "DIM('a) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5868
    by (simp add: le_Suc_eq aff_dim_hyperplane)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5869
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5870
  assume "DIM('a) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5871
  then show "bounded {x. a \<bullet> x = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5872
    by (simp add: aff_dim_hyperplane affine_bounded_eq_lowdim affine_hyperplane assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5873
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5874
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5875
lemma bounded_hyperplane_eq_trivial:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5876
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5877
  shows "bounded {x. a \<bullet> x = r} \<longleftrightarrow> (if a = 0 then r \<noteq> 0 else DIM('a) = 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5878
proof (simp add: bounded_hyperplane_eq_trivial_0, clarify)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5879
  assume "r \<noteq> 0" "a \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5880
  have "aff_dim {x. y \<bullet> x = 0} = aff_dim {x. a \<bullet> x = r}" if "y \<noteq> 0" for y::'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5881
    by (metis that \<open>a \<noteq> 0\<close> aff_dim_hyperplane)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5882
  then show "bounded {x. a \<bullet> x = r} = (DIM('a) = Suc 0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5883
    by (metis One_nat_def \<open>a \<noteq> 0\<close> affine_bounded_eq_lowdim affine_hyperplane bounded_hyperplane_eq_trivial_0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5884
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5885
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5886
subsection\<^marker>\<open>tag unimportant\<close>\<open>General case without assuming closure and getting non-strict separation\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5887
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5888
proposition\<^marker>\<open>tag unimportant\<close> separating_hyperplane_closed_point_inset:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5889
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5890
  assumes "convex S" "closed S" "S \<noteq> {}" "z \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5891
  obtains a b where "a \<in> S" "(a - z) \<bullet> z < b" "\<And>x. x \<in> S \<Longrightarrow> b < (a - z) \<bullet> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5892
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5893
  obtain y where "y \<in> S" and y: "\<And>u. u \<in> S \<Longrightarrow> dist z y \<le> dist z u"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5894
    using distance_attains_inf [of S z] assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5895
  then have *: "(y - z) \<bullet> z < (y - z) \<bullet> z + (norm (y - z))\<^sup>2 / 2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5896
    using \<open>y \<in> S\<close> \<open>z \<notin> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5897
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5898
  proof (rule that [OF \<open>y \<in> S\<close> *])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5899
    fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5900
    assume "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5901
    have yz: "0 < (y - z) \<bullet> (y - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5902
      using \<open>y \<in> S\<close> \<open>z \<notin> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5903
    { assume 0: "0 < ((z - y) \<bullet> (x - y))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5904
      with any_closest_point_dot [OF \<open>convex S\<close> \<open>closed S\<close>]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5905
      have False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5906
        using y \<open>x \<in> S\<close> \<open>y \<in> S\<close> not_less by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5907
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5908
    then have "0 \<le> ((y - z) \<bullet> (x - y))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5909
      by (force simp: not_less inner_diff_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5910
    with yz have "0 < 2 * ((y - z) \<bullet> (x - y)) + (y - z) \<bullet> (y - z)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5911
      by (simp add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5912
    then show "(y - z) \<bullet> z + (norm (y - z))\<^sup>2 / 2 < (y - z) \<bullet> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5913
      by (simp add: field_simps inner_diff_left inner_diff_right dot_square_norm [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5914
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5915
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5916
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5917
lemma separating_hyperplane_closed_0_inset:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5918
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5919
  assumes "convex S" "closed S" "S \<noteq> {}" "0 \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5920
  obtains a b where "a \<in> S" "a \<noteq> 0" "0 < b" "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x > b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5921
using separating_hyperplane_closed_point_inset [OF assms]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5922
by simp (metis \<open>0 \<notin> S\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5923
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5924
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  5925
proposition\<^marker>\<open>tag unimportant\<close> separating_hyperplane_set_0_inspan:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5926
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5927
  assumes "convex S" "S \<noteq> {}" "0 \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5928
  obtains a where "a \<in> span S" "a \<noteq> 0" "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> a \<bullet> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5929
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5930
  define k where [abs_def]: "k c = {x. 0 \<le> c \<bullet> x}" for c :: 'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5931
  have *: "span S \<inter> frontier (cball 0 1) \<inter> \<Inter>f' \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5932
          if f': "finite f'" "f' \<subseteq> k ` S" for f'
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5933
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5934
    obtain C where "C \<subseteq> S" "finite C" and C: "f' = k ` C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5935
      using finite_subset_image [OF f'] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5936
    obtain a where "a \<in> S" "a \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5937
      using \<open>S \<noteq> {}\<close> \<open>0 \<notin> S\<close> ex_in_conv by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5938
    then have "norm (a /\<^sub>R (norm a)) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5939
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5940
    moreover have "a /\<^sub>R (norm a) \<in> span S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  5941
      by (simp add: \<open>a \<in> S\<close> span_scale span_base)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5942
    ultimately have ass: "a /\<^sub>R (norm a) \<in> span S \<inter> sphere 0 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5943
      by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5944
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5945
    proof (cases "C = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5946
      case True with C ass show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5947
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5948
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5949
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5950
      have "closed (convex hull C)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5951
        using \<open>finite C\<close> compact_eq_bounded_closed finite_imp_compact_convex_hull by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5952
      moreover have "convex hull C \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5953
        by (simp add: False)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5954
      moreover have "0 \<notin> convex hull C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5955
        by (metis \<open>C \<subseteq> S\<close> \<open>convex S\<close> \<open>0 \<notin> S\<close> convex_hull_subset hull_same insert_absorb insert_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5956
      ultimately obtain a b
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5957
            where "a \<in> convex hull C" "a \<noteq> 0" "0 < b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5958
                  and ab: "\<And>x. x \<in> convex hull C \<Longrightarrow> a \<bullet> x > b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5959
        using separating_hyperplane_closed_0_inset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5960
      then have "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5961
        by (metis \<open>C \<subseteq> S\<close> assms(1) subsetCE subset_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5962
      moreover have "norm (a /\<^sub>R (norm a)) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5963
        using \<open>a \<noteq> 0\<close> by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5964
      moreover have "a /\<^sub>R (norm a) \<in> span S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  5965
        by (simp add: \<open>a \<in> S\<close> span_scale span_base)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5966
      ultimately have ass: "a /\<^sub>R (norm a) \<in> span S \<inter> sphere 0 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5967
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5968
      have aa: "a /\<^sub>R (norm a) \<in> (\<Inter>c\<in>C. {x. 0 \<le> c \<bullet> x})"
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  5969
        apply (clarsimp simp add: field_split_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5970
        using ab \<open>0 < b\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5971
        by (metis hull_inc inner_commute less_eq_real_def less_trans)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5972
      show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5973
        apply (simp add: C k_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5974
        using ass aa Int_iff empty_iff by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5975
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5976
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5977
  have "(span S \<inter> frontier(cball 0 1)) \<inter> (\<Inter> (k ` S)) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5978
    apply (rule compact_imp_fip)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5979
    apply (blast intro: compact_cball)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5980
    using closed_halfspace_ge k_def apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5981
    apply (metis *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5982
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5983
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5984
    unfolding set_eq_iff k_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5985
    by simp (metis inner_commute norm_eq_zero that zero_neq_one)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5986
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5987
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5988
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5989
lemma separating_hyperplane_set_point_inaff:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5990
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5991
  assumes "convex S" "S \<noteq> {}" and zno: "z \<notin> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5992
  obtains a b where "(z + a) \<in> affine hull (insert z S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5993
                and "a \<noteq> 0" and "a \<bullet> z \<le> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5994
                and "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> x \<ge> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  5995
proof -
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5996
  from separating_hyperplane_set_0_inspan [of "image (\<lambda>x. -z + x) S"]
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5997
  have "convex ((+) (- z) ` S)"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  5998
    using \<open>convex S\<close> by simp
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  5999
  moreover have "(+) (- z) ` S \<noteq> {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6000
    by (simp add: \<open>S \<noteq> {}\<close>)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6001
  moreover have "0 \<notin> (+) (- z) ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6002
    using zno by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6003
  ultimately obtain a where "a \<in> span ((+) (- z) ` S)" "a \<noteq> 0"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6004
                  and a:  "\<And>x. x \<in> ((+) (- z) ` S) \<Longrightarrow> 0 \<le> a \<bullet> x"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6005
    using separating_hyperplane_set_0_inspan [of "image (\<lambda>x. -z + x) S"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6006
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6007
  then have szx: "\<And>x. x \<in> S \<Longrightarrow> a \<bullet> z \<le> a \<bullet> x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6008
    by (metis (no_types, lifting) imageI inner_minus_right inner_right_distrib minus_add neg_le_0_iff_le neg_le_iff_le real_add_le_0_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6009
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6010
    apply (rule_tac a=a and b = "a  \<bullet> z" in that, simp_all)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6011
    using \<open>a \<in> span ((+) (- z) ` S)\<close> affine_hull_insert_span_gen apply blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6012
    apply (simp_all add: \<open>a \<noteq> 0\<close> szx)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6013
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6014
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6015
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6016
proposition\<^marker>\<open>tag unimportant\<close> supporting_hyperplane_rel_boundary:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6017
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6018
  assumes "convex S" "x \<in> S" and xno: "x \<notin> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6019
  obtains a where "a \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6020
              and "\<And>y. y \<in> S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6021
              and "\<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6022
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6023
  obtain a b where aff: "(x + a) \<in> affine hull (insert x (rel_interior S))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6024
                  and "a \<noteq> 0" and "a \<bullet> x \<le> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6025
                  and ageb: "\<And>u. u \<in> (rel_interior S) \<Longrightarrow> a \<bullet> u \<ge> b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6026
    using separating_hyperplane_set_point_inaff [of "rel_interior S" x] assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6027
    by (auto simp: rel_interior_eq_empty convex_rel_interior)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6028
  have le_ay: "a \<bullet> x \<le> a \<bullet> y" if "y \<in> S" for y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6029
  proof -
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6030
    have con: "continuous_on (closure (rel_interior S)) ((\<bullet>) a)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6031
      by (rule continuous_intros continuous_on_subset | blast)+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6032
    have y: "y \<in> closure (rel_interior S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6033
      using \<open>convex S\<close> closure_def convex_closure_rel_interior \<open>y \<in> S\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6034
      by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6035
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6036
      using continuous_ge_on_closure [OF con y] ageb \<open>a \<bullet> x \<le> b\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6037
      by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6038
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6039
  have 3: "a \<bullet> x < a \<bullet> y" if "y \<in> rel_interior S" for y
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6040
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6041
    obtain e where "0 < e" "y \<in> S" and e: "cball y e \<inter> affine hull S \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6042
      using \<open>y \<in> rel_interior S\<close> by (force simp: rel_interior_cball)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6043
    define y' where "y' = y - (e / norm a) *\<^sub>R ((x + a) - x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6044
    have "y' \<in> cball y e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6045
      unfolding y'_def using \<open>0 < e\<close> by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6046
    moreover have "y' \<in> affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6047
      unfolding y'_def
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6048
      by (metis \<open>x \<in> S\<close> \<open>y \<in> S\<close> \<open>convex S\<close> aff affine_affine_hull hull_redundant
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6049
                rel_interior_same_affine_hull hull_inc mem_affine_3_minus2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6050
    ultimately have "y' \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6051
      using e by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6052
    have "a \<bullet> x \<le> a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6053
      using le_ay \<open>a \<noteq> 0\<close> \<open>y \<in> S\<close> by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6054
    moreover have "a \<bullet> x \<noteq> a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6055
      using le_ay [OF \<open>y' \<in> S\<close>] \<open>a \<noteq> 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6056
      apply (simp add: y'_def inner_diff dot_square_norm power2_eq_square)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6057
      by (metis \<open>0 < e\<close> add_le_same_cancel1 inner_commute inner_real_def inner_zero_left le_diff_eq norm_le_zero_iff real_mult_le_cancel_iff2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6058
    ultimately show ?thesis by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6059
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6060
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6061
    by (rule that [OF \<open>a \<noteq> 0\<close> le_ay 3])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6062
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6063
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6064
lemma supporting_hyperplane_relative_frontier:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6065
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6066
  assumes "convex S" "x \<in> closure S" "x \<notin> rel_interior S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6067
  obtains a where "a \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6068
              and "\<And>y. y \<in> closure S \<Longrightarrow> a \<bullet> x \<le> a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6069
              and "\<And>y. y \<in> rel_interior S \<Longrightarrow> a \<bullet> x < a \<bullet> y"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6070
using supporting_hyperplane_rel_boundary [of "closure S" x]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6071
by (metis assms convex_closure convex_rel_interior_closure)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6072
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6073
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6074
subsection\<^marker>\<open>tag unimportant\<close>\<open> Some results on decomposing convex hulls: intersections, simplicial subdivision\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6075
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6076
lemma
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6077
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6078
  assumes "\<not> affine_dependent(s \<union> t)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6079
    shows convex_hull_Int_subset: "convex hull s \<inter> convex hull t \<subseteq> convex hull (s \<inter> t)" (is ?C)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6080
      and affine_hull_Int_subset: "affine hull s \<inter> affine hull t \<subseteq> affine hull (s \<inter> t)" (is ?A)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6081
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6082
  have [simp]: "finite s" "finite t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6083
    using aff_independent_finite assms by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6084
    have "sum u (s \<inter> t) = 1 \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6085
          (\<Sum>v\<in>s \<inter> t. u v *\<^sub>R v) = (\<Sum>v\<in>s. u v *\<^sub>R v)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6086
      if [simp]:  "sum u s = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6087
                 "sum v t = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6088
         and eq: "(\<Sum>x\<in>t. v x *\<^sub>R x) = (\<Sum>x\<in>s. u x *\<^sub>R x)" for u v
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6089
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6090
    define f where "f x = (if x \<in> s then u x else 0) - (if x \<in> t then v x else 0)" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6091
    have "sum f (s \<union> t) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6092
      apply (simp add: f_def sum_Un sum_subtractf)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6093
      apply (simp add: sum.inter_restrict [symmetric] Int_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6094
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6095
    moreover have "(\<Sum>x\<in>(s \<union> t). f x *\<^sub>R x) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6096
      apply (simp add: f_def sum_Un scaleR_left_diff_distrib sum_subtractf)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6097
      apply (simp add: if_smult sum.inter_restrict [symmetric] Int_commute eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6098
          cong del: if_weak_cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6099
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6100
    ultimately have "\<And>v. v \<in> s \<union> t \<Longrightarrow> f v = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6101
      using aff_independent_finite assms unfolding affine_dependent_explicit
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6102
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6103
    then have u [simp]: "\<And>x. x \<in> s \<Longrightarrow> u x = (if x \<in> t then v x else 0)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6104
      by (simp add: f_def) presburger
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6105
    have "sum u (s \<inter> t) = sum u s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6106
      by (simp add: sum.inter_restrict)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6107
    then have "sum u (s \<inter> t) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6108
      using that by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6109
    moreover have "(\<Sum>v\<in>s \<inter> t. u v *\<^sub>R v) = (\<Sum>v\<in>s. u v *\<^sub>R v)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6110
      by (auto simp: if_smult sum.inter_restrict intro: sum.cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6111
    ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6112
      by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6113
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6114
    then show ?A ?C
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6115
      by (auto simp: convex_hull_finite affine_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6116
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6117
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6118
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6119
proposition\<^marker>\<open>tag unimportant\<close> affine_hull_Int:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6120
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6121
  assumes "\<not> affine_dependent(s \<union> t)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6122
    shows "affine hull (s \<inter> t) = affine hull s \<inter> affine hull t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6123
apply (rule subset_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6124
apply (simp add: hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6125
by (simp add: affine_hull_Int_subset assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6126
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6127
proposition\<^marker>\<open>tag unimportant\<close> convex_hull_Int:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6128
  fixes s :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6129
  assumes "\<not> affine_dependent(s \<union> t)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6130
    shows "convex hull (s \<inter> t) = convex hull s \<inter> convex hull t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6131
apply (rule subset_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6132
apply (simp add: hull_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6133
by (simp add: convex_hull_Int_subset assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6134
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6135
proposition\<^marker>\<open>tag unimportant\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6136
  fixes s :: "'a::euclidean_space set set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6137
  assumes "\<not> affine_dependent (\<Union>s)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6138
    shows affine_hull_Inter: "affine hull (\<Inter>s) = (\<Inter>t\<in>s. affine hull t)" (is "?A")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6139
      and convex_hull_Inter: "convex hull (\<Inter>s) = (\<Inter>t\<in>s. convex hull t)" (is "?C")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6140
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6141
  have "finite s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6142
    using aff_independent_finite assms finite_UnionD by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6143
  then have "?A \<and> ?C" using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6144
  proof (induction s rule: finite_induct)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6145
    case empty then show ?case by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6146
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6147
    case (insert t F)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6148
    then show ?case
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6149
    proof (cases "F={}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6150
      case True then show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6151
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6152
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6153
      with "insert.prems" have [simp]: "\<not> affine_dependent (t \<union> \<Inter>F)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6154
        by (auto intro: affine_dependent_subset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6155
      have [simp]: "\<not> affine_dependent (\<Union>F)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6156
        using affine_independent_subset insert.prems by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6157
      show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6158
        by (simp add: affine_hull_Int convex_hull_Int insert.IH)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6159
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6160
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6161
  then show "?A" "?C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6162
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6163
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6164
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6165
proposition\<^marker>\<open>tag unimportant\<close> in_convex_hull_exchange_unique:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6166
  fixes S :: "'a::euclidean_space set"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6167
  assumes naff: "\<not> affine_dependent S" and a: "a \<in> convex hull S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6168
      and S: "T \<subseteq> S" "T' \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6169
      and x:  "x \<in> convex hull (insert a T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6170
      and x': "x \<in> convex hull (insert a T')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6171
    shows "x \<in> convex hull (insert a (T \<inter> T'))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6172
proof (cases "a \<in> S")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6173
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6174
  then have "\<not> affine_dependent (insert a T \<union> insert a T')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6175
    using affine_dependent_subset assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6176
  then have "x \<in> convex hull (insert a T \<inter> insert a T')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6177
    by (metis IntI convex_hull_Int x x')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6178
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6179
    by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6180
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6181
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6182
  then have anot: "a \<notin> T" "a \<notin> T'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6183
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6184
  have [simp]: "finite S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6185
    by (simp add: aff_independent_finite assms)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6186
  then obtain b where b0: "\<And>s. s \<in> S \<Longrightarrow> 0 \<le> b s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6187
                  and b1: "sum b S = 1" and aeq: "a = (\<Sum>s\<in>S. b s *\<^sub>R s)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6188
    using a by (auto simp: convex_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6189
  have fin [simp]: "finite T" "finite T'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6190
    using assms infinite_super \<open>finite S\<close> by blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6191
  then obtain c c' where c0: "\<And>t. t \<in> insert a T \<Longrightarrow> 0 \<le> c t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6192
                     and c1: "sum c (insert a T) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6193
                     and xeq: "x = (\<Sum>t \<in> insert a T. c t *\<^sub>R t)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6194
                     and c'0: "\<And>t. t \<in> insert a T' \<Longrightarrow> 0 \<le> c' t"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6195
                     and c'1: "sum c' (insert a T') = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6196
                     and x'eq: "x = (\<Sum>t \<in> insert a T'. c' t *\<^sub>R t)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6197
    using x x' by (auto simp: convex_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6198
  with fin anot
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6199
  have sumTT': "sum c T = 1 - c a" "sum c' T' = 1 - c' a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6200
   and wsumT: "(\<Sum>t \<in> T. c t *\<^sub>R t) = x - c a *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6201
    by simp_all
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6202
  have wsumT': "(\<Sum>t \<in> T'. c' t *\<^sub>R t) = x - c' a *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6203
    using x'eq fin anot by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6204
  define cc  where "cc \<equiv> \<lambda>x. if x \<in> T then c x else 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6205
  define cc' where "cc' \<equiv> \<lambda>x. if x \<in> T' then c' x else 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6206
  define dd  where "dd \<equiv> \<lambda>x. cc x - cc' x + (c a - c' a) * b x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6207
  have sumSS': "sum cc S = 1 - c a" "sum cc' S = 1 - c' a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6208
    unfolding cc_def cc'_def  using S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6209
    by (simp_all add: Int_absorb1 Int_absorb2 sum_subtractf sum.inter_restrict [symmetric] sumTT')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6210
  have wsumSS: "(\<Sum>t \<in> S. cc t *\<^sub>R t) = x - c a *\<^sub>R a" "(\<Sum>t \<in> S. cc' t *\<^sub>R t) = x - c' a *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6211
    unfolding cc_def cc'_def  using S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6212
    by (simp_all add: Int_absorb1 Int_absorb2 if_smult sum.inter_restrict [symmetric] wsumT wsumT' cong: if_cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6213
  have sum_dd0: "sum dd S = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6214
    unfolding dd_def  using S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6215
    by (simp add: sumSS' comm_monoid_add_class.sum.distrib sum_subtractf
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6216
                  algebra_simps sum_distrib_right [symmetric] b1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6217
  have "(\<Sum>v\<in>S. (b v * x) *\<^sub>R v) = x *\<^sub>R (\<Sum>v\<in>S. b v *\<^sub>R v)" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6218
    by (simp add: pth_5 real_vector.scale_sum_right mult.commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6219
  then have *: "(\<Sum>v\<in>S. (b v * x) *\<^sub>R v) = x *\<^sub>R a" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6220
    using aeq by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6221
  have "(\<Sum>v \<in> S. dd v *\<^sub>R v) = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6222
    unfolding dd_def using S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6223
    by (simp add: * wsumSS sum.distrib sum_subtractf algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6224
  then have dd0: "dd v = 0" if "v \<in> S" for v
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6225
    using naff that \<open>finite S\<close> sum_dd0 unfolding affine_dependent_explicit
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6226
    apply (simp only: not_ex)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6227
    apply (drule_tac x=S in spec)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6228
    apply (drule_tac x=dd in spec, simp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6229
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6230
  consider "c' a \<le> c a" | "c a \<le> c' a" by linarith
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6231
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6232
  proof cases
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6233
    case 1
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6234
    then have "sum cc S \<le> sum cc' S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6235
      by (simp add: sumSS')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6236
    then have le: "cc x \<le> cc' x" if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6237
      using dd0 [OF that] 1 b0 mult_left_mono that
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6238
      by (fastforce simp add: dd_def algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6239
    have cc0: "cc x = 0" if "x \<in> S" "x \<notin> T \<inter> T'" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6240
      using le [OF \<open>x \<in> S\<close>] that c0
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6241
      by (force simp: cc_def cc'_def split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6242
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6243
    proof (simp add: convex_hull_finite, intro exI conjI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6244
      show "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc(a := c a)) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6245
        by (simp add: c0 cc_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6246
      show "0 \<le> (cc(a := c a)) a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6247
        by (simp add: c0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6248
      have "sum (cc(a := c a)) (insert a (T \<inter> T')) = c a + sum (cc(a := c a)) (T \<inter> T')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6249
        by (simp add: anot)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6250
      also have "... = c a + sum (cc(a := c a)) S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6251
        apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6252
        apply (rule sum.mono_neutral_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6253
        using \<open>T \<subseteq> S\<close> apply (auto simp: \<open>a \<notin> S\<close> cc0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6254
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6255
      also have "... = c a + (1 - c a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6256
        by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6257
      finally show "sum (cc(a := c a)) (insert a (T \<inter> T')) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6258
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6259
      have "(\<Sum>x\<in>insert a (T \<inter> T'). (cc(a := c a)) x *\<^sub>R x) = c a *\<^sub>R a + (\<Sum>x \<in> T \<inter> T'. (cc(a := c a)) x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6260
        by (simp add: anot)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6261
      also have "... = c a *\<^sub>R a + (\<Sum>x \<in> S. (cc(a := c a)) x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6262
        apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6263
        apply (rule sum.mono_neutral_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6264
        using \<open>T \<subseteq> S\<close> apply (auto simp: \<open>a \<notin> S\<close> cc0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6265
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6266
      also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6267
        by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6268
      finally show "(\<Sum>x\<in>insert a (T \<inter> T'). (cc(a := c a)) x *\<^sub>R x) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6269
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6270
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6271
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6272
    case 2
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6273
    then have "sum cc' S \<le> sum cc S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6274
      by (simp add: sumSS')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6275
    then have le: "cc' x \<le> cc x" if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6276
      using dd0 [OF that] 2 b0 mult_left_mono that
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6277
      by (fastforce simp add: dd_def algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6278
    have cc0: "cc' x = 0" if "x \<in> S" "x \<notin> T \<inter> T'" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6279
      using le [OF \<open>x \<in> S\<close>] that c'0
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6280
      by (force simp: cc_def cc'_def split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6281
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6282
    proof (simp add: convex_hull_finite, intro exI conjI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6283
      show "\<forall>x\<in>T \<inter> T'. 0 \<le> (cc'(a := c' a)) x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6284
        by (simp add: c'0 cc'_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6285
      show "0 \<le> (cc'(a := c' a)) a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6286
        by (simp add: c'0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6287
      have "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = c' a + sum (cc'(a := c' a)) (T \<inter> T')"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6288
        by (simp add: anot)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6289
      also have "... = c' a + sum (cc'(a := c' a)) S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6290
        apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6291
        apply (rule sum.mono_neutral_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6292
        using \<open>T \<subseteq> S\<close> apply (auto simp: \<open>a \<notin> S\<close> cc0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6293
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6294
      also have "... = c' a + (1 - c' a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6295
        by (metis \<open>a \<notin> S\<close> fun_upd_other sum.cong sumSS')
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6296
      finally show "sum (cc'(a := c' a)) (insert a (T \<inter> T')) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6297
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6298
      have "(\<Sum>x\<in>insert a (T \<inter> T'). (cc'(a := c' a)) x *\<^sub>R x) = c' a *\<^sub>R a + (\<Sum>x \<in> T \<inter> T'. (cc'(a := c' a)) x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6299
        by (simp add: anot)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6300
      also have "... = c' a *\<^sub>R a + (\<Sum>x \<in> S. (cc'(a := c' a)) x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6301
        apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6302
        apply (rule sum.mono_neutral_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6303
        using \<open>T \<subseteq> S\<close> apply (auto simp: \<open>a \<notin> S\<close> cc0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6304
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6305
      also have "... = c a *\<^sub>R a + x - c a *\<^sub>R a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6306
        by (simp add: wsumSS \<open>a \<notin> S\<close> if_smult sum_delta_notmem)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6307
      finally show "(\<Sum>x\<in>insert a (T \<inter> T'). (cc'(a := c' a)) x *\<^sub>R x) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6308
        by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6309
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6310
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6311
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6312
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6313
corollary\<^marker>\<open>tag unimportant\<close> convex_hull_exchange_Int:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6314
  fixes a  :: "'a::euclidean_space"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6315
  assumes "\<not> affine_dependent S" "a \<in> convex hull S" "T \<subseteq> S" "T' \<subseteq> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6316
  shows "(convex hull (insert a T)) \<inter> (convex hull (insert a T')) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6317
         convex hull (insert a (T \<inter> T'))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6318
apply (rule subset_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6319
  using in_convex_hull_exchange_unique assms apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6320
  by (metis hull_mono inf_le1 inf_le2 insert_inter_insert le_inf_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6321
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6322
lemma Int_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6323
  fixes b :: "'a::euclidean_space"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6324
  assumes "b \<in> closed_segment a c \<or> \<not> collinear{a,b,c}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6325
    shows "closed_segment a b \<inter> closed_segment b c = {b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6326
proof (cases "c = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6327
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6328
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6329
    using assms collinear_3_eq_affine_dependent by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6330
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6331
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6332
  from assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6333
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6334
    assume "b \<in> closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6335
    moreover have "\<not> affine_dependent {a, c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6336
      by (simp add: affine_independent_2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6337
    ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6338
      using False convex_hull_exchange_Int [of "{a,c}" b "{a}" "{c}"]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6339
      by (simp add: segment_convex_hull insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6340
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6341
    assume ncoll: "\<not> collinear {a, b, c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6342
    have False if "closed_segment a b \<inter> closed_segment b c \<noteq> {b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6343
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6344
      have "b \<in> closed_segment a b" and "b \<in> closed_segment b c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6345
        by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6346
      with that obtain d where "b \<noteq> d" "d \<in> closed_segment a b" "d \<in> closed_segment b c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6347
        by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6348
      then have d: "collinear {a, d, b}"  "collinear {b, d, c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6349
        by (auto simp:  between_mem_segment between_imp_collinear)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6350
      have "collinear {a, b, c}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6351
        apply (rule collinear_3_trans [OF _ _ \<open>b \<noteq> d\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6352
        using d  by (auto simp: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6353
      with ncoll show False ..
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6354
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6355
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6356
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6357
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6358
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6359
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6360
lemma affine_hull_finite_intersection_hyperplanes:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6361
  fixes s :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6362
  obtains f where
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6363
     "finite f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6364
     "of_nat (card f) + aff_dim s = DIM('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6365
     "affine hull s = \<Inter>f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6366
     "\<And>h. h \<in> f \<Longrightarrow> \<exists>a b. a \<noteq> 0 \<and> h = {x. a \<bullet> x = b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6367
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6368
  obtain b where "b \<subseteq> s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6369
             and indb: "\<not> affine_dependent b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6370
             and eq: "affine hull s = affine hull b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6371
    using affine_basis_exists by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6372
  obtain c where indc: "\<not> affine_dependent c" and "b \<subseteq> c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6373
             and affc: "affine hull c = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6374
    by (metis extend_to_affine_basis affine_UNIV hull_same indb subset_UNIV)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6375
  then have "finite c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6376
    by (simp add: aff_independent_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6377
  then have fbc: "finite b" "card b \<le> card c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6378
    using \<open>b \<subseteq> c\<close> infinite_super by (auto simp: card_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6379
  have imeq: "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b)) = ((\<lambda>a. affine hull (c - {a})) ` (c - b))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6380
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6381
  have card1: "card ((\<lambda>a. affine hull (c - {a})) ` (c - b)) = card (c - b)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6382
    apply (rule card_image [OF inj_onI])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6383
    by (metis Diff_eq_empty_iff Diff_iff indc affine_dependent_def hull_subset insert_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6384
  have card2: "(card (c - b)) + aff_dim s = DIM('a)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6385
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6386
    have aff: "aff_dim (UNIV::'a set) = aff_dim c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6387
      by (metis aff_dim_affine_hull affc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6388
    have "aff_dim b = aff_dim s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6389
      by (metis (no_types) aff_dim_affine_hull eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6390
    then have "int (card b) = 1 + aff_dim s"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6391
      by (simp add: aff_dim_affine_independent indb)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6392
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6393
      using fbc aff
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6394
      by (simp add: \<open>\<not> affine_dependent c\<close> \<open>b \<subseteq> c\<close> aff_dim_affine_independent aff_dim_UNIV card_Diff_subset of_nat_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6395
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6396
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6397
  proof (cases "c = b")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6398
    case True show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6399
      apply (rule_tac f="{}" in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6400
      using True affc
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6401
      apply (simp_all add: eq [symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6402
      by (metis aff_dim_UNIV aff_dim_affine_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6403
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6404
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6405
    have ind: "\<not> affine_dependent (\<Union>a\<in>c - b. c - {a})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6406
      by (rule affine_independent_subset [OF indc]) auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6407
    have affeq: "affine hull s = (\<Inter>x\<in>(\<lambda>a. c - {a}) ` (c - b). affine hull x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6408
      using \<open>b \<subseteq> c\<close> False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6409
      apply (subst affine_hull_Inter [OF ind, symmetric])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6410
      apply (simp add: eq double_diff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6411
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6412
    have *: "1 + aff_dim (c - {t}) = int (DIM('a))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6413
            if t: "t \<in> c" for t
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6414
    proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6415
      have "insert t c = c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6416
        using t by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6417
      then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6418
        by (metis (full_types) add.commute aff_dim_affine_hull aff_dim_insert aff_dim_UNIV affc affine_dependent_def indc insert_Diff_single t)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6419
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6420
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6421
      apply (rule_tac f = "(\<lambda>x. affine hull x) ` ((\<lambda>a. c - {a}) ` (c - b))" in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6422
         using \<open>finite c\<close> apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6423
        apply (simp add: imeq card1 card2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6424
      apply (simp add: affeq, clarify)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6425
      apply (metis DIM_positive One_nat_def Suc_leI add_diff_cancel_left' of_nat_1 aff_dim_eq_hyperplane of_nat_diff *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6426
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6427
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6428
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6429
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6430
lemma affine_hyperplane_sums_eq_UNIV_0:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6431
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6432
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6433
     and "0 \<in> S" and "w \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6434
     and "a \<bullet> w \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6435
   shows "{x + y| x y. x \<in> S \<and> a \<bullet> y = 0} = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6436
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6437
  have "subspace S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6438
    by (simp add: assms subspace_affine)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6439
  have span1: "span {y. a \<bullet> y = 0} \<subseteq> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6440
    apply (rule span_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6441
    using \<open>0 \<in> S\<close> add.left_neutral by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6442
  have "w \<notin> span {y. a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6443
    using \<open>a \<bullet> w \<noteq> 0\<close> span_induct subspace_hyperplane by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6444
  moreover have "w \<in> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6445
    using \<open>w \<in> S\<close>
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6446
    by (metis (mono_tags, lifting) inner_zero_right mem_Collect_eq pth_d span_base)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6447
  ultimately have span2: "span {y. a \<bullet> y = 0} \<noteq> span {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6448
    by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6449
  have "a \<noteq> 0" using assms inner_zero_left by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6450
  then have "DIM('a) - 1 = dim {y. a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6451
    by (simp add: dim_hyperplane)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6452
  also have "... < dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6453
    using span1 span2 by (blast intro: dim_psubset)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6454
  finally have DIM_lt: "DIM('a) - 1 < dim {x + y |x y. x \<in> S \<and> a \<bullet> y = 0}" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6455
  have subs: "subspace {x + y| x y. x \<in> S \<and> a \<bullet> y = 0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6456
    using subspace_sums [OF \<open>subspace S\<close> subspace_hyperplane] by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6457
  moreover have "span {x + y| x y. x \<in> S \<and> a \<bullet> y = 0} = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6458
    apply (rule dim_eq_full [THEN iffD1])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6459
    apply (rule antisym [OF dim_subset_UNIV])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6460
    using DIM_lt apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6461
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6462
  ultimately show ?thesis
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6463
    by (simp add: subs) (metis (lifting) span_eq_iff subs)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6464
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6465
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6466
proposition\<^marker>\<open>tag unimportant\<close> affine_hyperplane_sums_eq_UNIV:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6467
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6468
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6469
      and "S \<inter> {v. a \<bullet> v = b} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6470
      and "S - {v. a \<bullet> v = b} \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6471
    shows "{x + y| x y. x \<in> S \<and> a \<bullet> y = b} = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6472
proof (cases "a = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6473
  case True with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6474
    by (auto simp: if_splits)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6475
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6476
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6477
  obtain c where "c \<in> S" and c: "a \<bullet> c = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6478
    using assms by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6479
  with affine_diffs_subspace [OF \<open>affine S\<close>]
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6480
  have "subspace ((+) (- c) ` S)" by blast
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6481
  then have aff: "affine ((+) (- c) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6482
    by (simp add: subspace_imp_affine)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6483
  have 0: "0 \<in> (+) (- c) ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6484
    by (simp add: \<open>c \<in> S\<close>)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6485
  obtain d where "d \<in> S" and "a \<bullet> d \<noteq> b" and dc: "d-c \<in> (+) (- c) ` S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6486
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6487
  then have adc: "a \<bullet> (d - c) \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6488
    by (simp add: c inner_diff_right)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6489
  let ?U = "(+) (c+c) ` {x + y |x y. x \<in> (+) (- c) ` S \<and> a \<bullet> y = 0}"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6490
  have "u + v \<in> (+) (c + c) ` {x + v |x v. x \<in> (+) (- c) ` S \<and> a \<bullet> v = 0}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6491
              if "u \<in> S" "b = a \<bullet> v" for u v
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6492
    apply (rule_tac x="u+v-c-c" in image_eqI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6493
    apply (simp_all add: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6494
    apply (rule_tac x="u-c" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6495
    apply (rule_tac x="v-c" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6496
    apply (simp add: algebra_simps that c)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6497
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6498
  moreover have "\<lbrakk>a \<bullet> v = 0; u \<in> S\<rbrakk>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6499
       \<Longrightarrow> \<exists>x ya. v + (u + c) = x + ya \<and> x \<in> S \<and> a \<bullet> ya = b" for v u
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6500
    by (metis add.left_commute c inner_right_distrib pth_d)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6501
  ultimately have "{x + y |x y. x \<in> S \<and> a \<bullet> y = b} = ?U"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6502
    by (fastforce simp: algebra_simps)
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6503
  also have "... = range ((+) (c + c))"
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6504
    by (simp only: affine_hyperplane_sums_eq_UNIV_0 [OF aff 0 dc adc])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6505
  also have "... = UNIV"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6506
    by simp
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6507
  finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6508
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6509
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6510
lemma aff_dim_sums_Int_0:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6511
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6512
      and "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6513
      and "0 \<in> S" "0 \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6514
    shows "aff_dim {x + y| x y. x \<in> S \<and> y \<in> T} = (aff_dim S + aff_dim T) - aff_dim(S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6515
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6516
  have "0 \<in> {x + y |x y. x \<in> S \<and> y \<in> T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6517
    using assms by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6518
  then have 0: "0 \<in> affine hull {x + y |x y. x \<in> S \<and> y \<in> T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6519
    by (metis (lifting) hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6520
  have sub: "subspace S"  "subspace T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6521
    using assms by (auto simp: subspace_affine)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6522
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6523
    using dim_sums_Int [OF sub] by (simp add: aff_dim_zero assms 0 hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6524
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6525
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6526
proposition aff_dim_sums_Int:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6527
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6528
      and "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6529
      and "S \<inter> T \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6530
    shows "aff_dim {x + y| x y. x \<in> S \<and> y \<in> T} = (aff_dim S + aff_dim T) - aff_dim(S \<inter> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6531
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6532
  obtain a where a: "a \<in> S" "a \<in> T" using assms by force
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6533
  have aff: "affine ((+) (-a) ` S)"  "affine ((+) (-a) ` T)"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6534
    using affine_translation [symmetric, of "- a"] assms by (simp_all cong: image_cong_simp)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6535
  have zero: "0 \<in> ((+) (-a) ` S)"  "0 \<in> ((+) (-a) ` T)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6536
    using a assms by auto
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6537
  have "{x + y |x y. x \<in> (+) (- a) ` S \<and> y \<in> (+) (- a) ` T} =
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6538
      (+) (- 2 *\<^sub>R a) ` {x + y| x y. x \<in> S \<and> y \<in> T}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6539
    by (force simp: algebra_simps scaleR_2)
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6540
  moreover have "(+) (- a) ` S \<inter> (+) (- a) ` T = (+) (- a) ` (S \<inter> T)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6541
    by auto
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6542
  ultimately show ?thesis
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6543
    using aff_dim_sums_Int_0 [OF aff zero] aff_dim_translation_eq
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6544
    by (metis (lifting))
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6545
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6546
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6547
lemma aff_dim_affine_Int_hyperplane:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6548
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6549
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6550
    shows "aff_dim(S \<inter> {x. a \<bullet> x = b}) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6551
             (if S \<inter> {v. a \<bullet> v = b} = {} then - 1
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6552
              else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6553
              else aff_dim S - 1)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6554
proof (cases "a = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6555
  case True with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6556
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6557
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6558
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6559
  then have "aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6560
            if "x \<in> S" "a \<bullet> x \<noteq> b" and non: "S \<inter> {v. a \<bullet> v = b} \<noteq> {}" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6561
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6562
    have [simp]: "{x + y| x y. x \<in> S \<and> a \<bullet> y = b} = UNIV"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6563
      using affine_hyperplane_sums_eq_UNIV [OF assms non] that  by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6564
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6565
      using aff_dim_sums_Int [OF assms affine_hyperplane non]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6566
      by (simp add: of_nat_diff False)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6567
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6568
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6569
    by (metis (mono_tags, lifting) inf.orderE aff_dim_empty_eq mem_Collect_eq subsetI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6570
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6571
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6572
lemma aff_dim_lt_full:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6573
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6574
  shows "aff_dim S < DIM('a) \<longleftrightarrow> (affine hull S \<noteq> UNIV)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6575
by (metis (no_types) aff_dim_affine_hull aff_dim_le_DIM aff_dim_UNIV affine_hull_UNIV less_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6576
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6577
lemma aff_dim_openin:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6578
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  6579
  assumes ope: "openin (top_of_set T) S" and "affine T" "S \<noteq> {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6580
  shows "aff_dim S = aff_dim T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6581
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6582
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6583
  proof (rule order_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6584
    show "aff_dim S \<le> aff_dim T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6585
      by (blast intro: aff_dim_subset [OF openin_imp_subset] ope)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6586
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6587
    obtain a where "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6588
      using \<open>S \<noteq> {}\<close> by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6589
    have "S \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6590
      using ope openin_imp_subset by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6591
    then have "a \<in> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6592
      using \<open>a \<in> S\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6593
    then have subT': "subspace ((\<lambda>x. - a + x) ` T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6594
      using affine_diffs_subspace \<open>affine T\<close> by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6595
    then obtain B where Bsub: "B \<subseteq> ((\<lambda>x. - a + x) ` T)" and po: "pairwise orthogonal B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6596
                    and eq1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1" and "independent B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6597
                    and cardB: "card B = dim ((\<lambda>x. - a + x) ` T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6598
                    and spanB: "span B = ((\<lambda>x. - a + x) ` T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6599
      by (rule orthonormal_basis_subspace) auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6600
    obtain e where "0 < e" and e: "cball a e \<inter> T \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6601
      by (meson \<open>a \<in> S\<close> openin_contains_cball ope)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6602
    have "aff_dim T = aff_dim ((\<lambda>x. - a + x) ` T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6603
      by (metis aff_dim_translation_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6604
    also have "... = dim ((\<lambda>x. - a + x) ` T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6605
      using aff_dim_subspace subT' by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6606
    also have "... = card B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6607
      by (simp add: cardB)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6608
    also have "... = card ((\<lambda>x. e *\<^sub>R x) ` B)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6609
      using \<open>0 < e\<close>  by (force simp: inj_on_def card_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6610
    also have "... \<le> dim ((\<lambda>x. - a + x) ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6611
    proof (simp, rule independent_card_le_dim)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6612
      have e': "cball 0 e \<inter> (\<lambda>x. x - a) ` T \<subseteq> (\<lambda>x. x - a) ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6613
        using e by (auto simp: dist_norm norm_minus_commute subset_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6614
      have "(\<lambda>x. e *\<^sub>R x) ` B \<subseteq> cball 0 e \<inter> (\<lambda>x. x - a) ` T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6615
        using Bsub \<open>0 < e\<close> eq1 subT' \<open>a \<in> T\<close> by (auto simp: subspace_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6616
      then show "(\<lambda>x. e *\<^sub>R x) ` B \<subseteq> (\<lambda>x. x - a) ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6617
        using e' by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6618
      show "independent ((\<lambda>x. e *\<^sub>R x) ` B)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6619
        using linear_scale_self \<open>independent B\<close>
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6620
        apply (rule linear_independent_injective_image)
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6621
        using \<open>0 < e\<close> inj_on_def by fastforce
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6622
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6623
    also have "... = aff_dim S"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6624
      using \<open>a \<in> S\<close> aff_dim_eq_dim hull_inc by (force cong: image_cong_simp)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6625
    finally show "aff_dim T \<le> aff_dim S" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6626
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6627
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6628
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6629
lemma dim_openin:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6630
  fixes S :: "'a::euclidean_space set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  6631
  assumes ope: "openin (top_of_set T) S" and "subspace T" "S \<noteq> {}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6632
  shows "dim S = dim T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6633
proof (rule order_antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6634
  show "dim S \<le> dim T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6635
    by (metis ope dim_subset openin_subset topspace_euclidean_subtopology)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6636
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6637
  have "dim T = aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6638
    using aff_dim_openin
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6639
    by (metis aff_dim_subspace \<open>subspace T\<close> \<open>S \<noteq> {}\<close> ope subspace_affine)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6640
  also have "... \<le> dim S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6641
    by (metis aff_dim_subset aff_dim_subspace dim_span span_superset
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6642
        subspace_span)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6643
  finally show "dim T \<le> dim S" by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6644
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6645
67968
a5ad4c015d1c removed dots at the end of (sub)titles
nipkow
parents: 67962
diff changeset
  6646
subsection\<open>Lower-dimensional affine subsets are nowhere dense\<close>
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6647
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  6648
proposition dense_complement_subspace:
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6649
  fixes S :: "'a :: euclidean_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6650
  assumes dim_less: "dim T < dim S" and "subspace S" shows "closure(S - T) = S"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  6651
proof -
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6652
  have "closure(S - U) = S" if "dim U < dim S" "U \<subseteq> S" for U
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6653
  proof -
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6654
    have "span U \<subset> span S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6655
      by (metis neq_iff psubsetI span_eq_dim span_mono that)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6656
    then obtain a where "a \<noteq> 0" "a \<in> span S" and a: "\<And>y. y \<in> span U \<Longrightarrow> orthogonal a y"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6657
      using orthogonal_to_subspace_exists_gen by metis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6658
    show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6659
    proof
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6660
      have "closed S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6661
        by (simp add: \<open>subspace S\<close> closed_subspace)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6662
      then show "closure (S - U) \<subseteq> S"
69286
nipkow
parents: 69272
diff changeset
  6663
        by (simp add: closure_minimal)
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6664
      show "S \<subseteq> closure (S - U)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6665
      proof (clarsimp simp: closure_approachable)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6666
        fix x and e::real
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6667
        assume "x \<in> S" "0 < e"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6668
        show "\<exists>y\<in>S - U. dist y x < e"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6669
        proof (cases "x \<in> U")
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6670
          case True
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6671
          let ?y = "x + (e/2 / norm a) *\<^sub>R a"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6672
          show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6673
          proof
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6674
            show "dist ?y x < e"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6675
              using \<open>0 < e\<close> by (simp add: dist_norm)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6676
          next
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6677
            have "?y \<in> S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6678
              by (metis \<open>a \<in> span S\<close> \<open>x \<in> S\<close> assms(2) span_eq_iff subspace_add subspace_scale)
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6679
            moreover have "?y \<notin> U"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6680
            proof -
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6681
              have "e/2 / norm a \<noteq> 0"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6682
                using \<open>0 < e\<close> \<open>a \<noteq> 0\<close> by auto
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6683
              then show ?thesis
68074
8d50467f7555 fixed HOL-Analysis
immler
parents: 68073
diff changeset
  6684
                by (metis True \<open>a \<noteq> 0\<close> a orthogonal_scaleR orthogonal_self real_vector.scale_eq_0_iff span_add_eq span_base)
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6685
            qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6686
            ultimately show "?y \<in> S - U" by blast
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6687
          qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6688
        next
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6689
          case False
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6690
          with \<open>0 < e\<close> \<open>x \<in> S\<close> show ?thesis by force
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6691
        qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6692
      qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6693
    qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6694
  qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6695
  moreover have "S - S \<inter> T = S-T"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6696
    by blast
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6697
  moreover have "dim (S \<inter> T) < dim S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6698
    by (metis dim_less dim_subset inf.cobounded2 inf.orderE inf.strict_boundedE not_le)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6699
  ultimately show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6700
    by force
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6701
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6702
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6703
corollary\<^marker>\<open>tag unimportant\<close> dense_complement_affine:
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6704
  fixes S :: "'a :: euclidean_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6705
  assumes less: "aff_dim T < aff_dim S" and "affine S" shows "closure(S - T) = S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6706
proof (cases "S \<inter> T = {}")
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6707
  case True
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6708
  then show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6709
    by (metis Diff_triv affine_hull_eq \<open>affine S\<close> closure_same_affine_hull closure_subset hull_subset subset_antisym)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6710
next
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6711
  case False
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6712
  then obtain z where z: "z \<in> S \<inter> T" by blast
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6713
  then have "subspace ((+) (- z) ` S)"
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6714
    by (meson IntD1 affine_diffs_subspace \<open>affine S\<close>)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6715
  moreover have "int (dim ((+) (- z) ` T)) < int (dim ((+) (- z) ` S))"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6716
thm aff_dim_eq_dim
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6717
    using z less by (simp add: aff_dim_eq_dim_subtract [of z] hull_inc cong: image_cong_simp)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6718
  ultimately have "closure(((+) (- z) ` S) - ((+) (- z) ` T)) = ((+) (- z) ` S)"
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6719
    by (simp add: dense_complement_subspace)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6720
  then show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6721
    by (metis closure_translation translation_diff translation_invert)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6722
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6723
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6724
corollary\<^marker>\<open>tag unimportant\<close> dense_complement_openin_affine_hull:
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6725
  fixes S :: "'a :: euclidean_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6726
  assumes less: "aff_dim T < aff_dim S"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  6727
      and ope: "openin (top_of_set (affine hull S)) S"
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6728
    shows "closure(S - T) = closure S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6729
proof -
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6730
  have "affine hull S - T \<subseteq> affine hull S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6731
    by blast
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6732
  then have "closure (S \<inter> closure (affine hull S - T)) = closure (S \<inter> (affine hull S - T))"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6733
    by (rule closure_openin_Int_closure [OF ope])
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6734
  then show ?thesis
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6735
    by (metis Int_Diff aff_dim_affine_hull affine_affine_hull dense_complement_affine hull_subset inf.orderE less)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6736
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6737
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6738
corollary\<^marker>\<open>tag unimportant\<close> dense_complement_convex:
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6739
  fixes S :: "'a :: euclidean_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6740
  assumes "aff_dim T < aff_dim S" "convex S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6741
    shows "closure(S - T) = closure S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6742
proof
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6743
  show "closure (S - T) \<subseteq> closure S"
69286
nipkow
parents: 69272
diff changeset
  6744
    by (simp add: closure_mono)
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6745
  have "closure (rel_interior S - T) = closure (rel_interior S)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6746
    apply (rule dense_complement_openin_affine_hull)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6747
    apply (simp add: assms rel_interior_aff_dim)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6748
    using \<open>convex S\<close> rel_interior_rel_open rel_open by blast
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6749
  then show "closure S \<subseteq> closure (S - T)"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6750
    by (metis Diff_mono \<open>convex S\<close> closure_mono convex_closure_rel_interior order_refl rel_interior_subset)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6751
qed
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6752
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6753
corollary\<^marker>\<open>tag unimportant\<close> dense_complement_convex_closed:
66641
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6754
  fixes S :: "'a :: euclidean_space set"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6755
  assumes "aff_dim T < aff_dim S" "convex S" "closed S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6756
    shows "closure(S - T) = S"
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6757
  by (simp add: assms dense_complement_convex)
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6758
ff2e0115fea4 Simplicial complexes and triangulations; Baire Category Theorem
paulson <lp15@cam.ac.uk>
parents: 66297
diff changeset
  6759
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6760
subsection\<^marker>\<open>tag unimportant\<close>\<open>Parallel slices, etc\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6761
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6762
text\<open> If we take a slice out of a set, we can do it perpendicularly,
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6763
  with the normal vector to the slice parallel to the affine hull.\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6764
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  6765
proposition\<^marker>\<open>tag unimportant\<close> affine_parallel_slice:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6766
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6767
  assumes "affine S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6768
      and "S \<inter> {x. a \<bullet> x \<le> b} \<noteq> {}"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  6769
      and "\<not> (S \<subseteq> {x. a \<bullet> x \<le> b})"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6770
  obtains a' b' where "a' \<noteq> 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6771
                   "S \<inter> {x. a' \<bullet> x \<le> b'} = S \<inter> {x. a \<bullet> x \<le> b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6772
                   "S \<inter> {x. a' \<bullet> x = b'} = S \<inter> {x. a \<bullet> x = b}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6773
                   "\<And>w. w \<in> S \<Longrightarrow> (w + a') \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6774
proof (cases "S \<inter> {x. a \<bullet> x = b} = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6775
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6776
  then obtain u v where "u \<in> S" "v \<in> S" "a \<bullet> u \<le> b" "a \<bullet> v > b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6777
    using assms by (auto simp: not_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6778
  define \<eta> where "\<eta> = u + ((b - a \<bullet> u) / (a \<bullet> v - a \<bullet> u)) *\<^sub>R (v - u)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6779
  have "\<eta> \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6780
    by (simp add: \<eta>_def \<open>u \<in> S\<close> \<open>v \<in> S\<close> \<open>affine S\<close> mem_affine_3_minus)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6781
  moreover have "a \<bullet> \<eta> = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6782
    using \<open>a \<bullet> u \<le> b\<close> \<open>b < a \<bullet> v\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6783
    by (simp add: \<eta>_def algebra_simps) (simp add: field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6784
  ultimately have False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6785
    using True by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6786
  then show ?thesis ..
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6787
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6788
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6789
  then obtain z where "z \<in> S" and z: "a \<bullet> z = b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6790
    using assms by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6791
  with affine_diffs_subspace [OF \<open>affine S\<close>]
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6792
  have sub: "subspace ((+) (- z) ` S)" by blast
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6793
  then have aff: "affine ((+) (- z) ` S)" and span: "span ((+) (- z) ` S) = ((+) (- z) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6794
    by (auto simp: subspace_imp_affine)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6795
  obtain a' a'' where a': "a' \<in> span ((+) (- z) ` S)" and a: "a = a' + a''"
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6796
                  and "\<And>w. w \<in> span ((+) (- z) ` S) \<Longrightarrow> orthogonal a'' w"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6797
    using orthogonal_subspace_decomp_exists [of "(+) (- z) ` S" "a"] by metis
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6798
  then have "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> (w-z) = 0"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6799
    by (simp add: span_base orthogonal_def)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6800
  then have a'': "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> w = (a - a') \<bullet> z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6801
    by (simp add: a inner_diff_right)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6802
  then have ba'': "\<And>w. w \<in> S \<Longrightarrow> a'' \<bullet> w = b - a' \<bullet> z"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6803
    by (simp add: inner_diff_left z)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6804
  have "\<And>w. w \<in> (+) (- z) ` S \<Longrightarrow> (w + a') \<in> (+) (- z) ` S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6805
    by (metis subspace_add a' span_eq_iff sub)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6806
  then have Sclo: "\<And>w. w \<in> S \<Longrightarrow> (w + a') \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6807
    by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6808
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6809
  proof (cases "a' = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6810
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6811
    with a assms True a'' diff_zero less_irrefl show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6812
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6813
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6814
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6815
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6816
      apply (rule_tac a' = "a'" and b' = "a' \<bullet> z" in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6817
      apply (auto simp: a ba'' inner_left_distrib False Sclo)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6818
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6819
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6820
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6821
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6822
lemma diffs_affine_hull_span:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6823
  assumes "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6824
    shows "{x - a |x. x \<in> affine hull S} = span {x - a |x. x \<in> S}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6825
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6826
  have *: "((\<lambda>x. x - a) ` (S - {a})) = {x. x + a \<in> S} - {0}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6827
    by (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6828
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6829
    apply (simp add: affine_hull_span2 [OF assms] *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6830
    apply (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6831
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6832
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6833
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6834
lemma aff_dim_dim_affine_diffs:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6835
  fixes S :: "'a :: euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6836
  assumes "affine S" "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6837
    shows "aff_dim S = dim {x - a |x. x \<in> S}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6838
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6839
  obtain B where aff: "affine hull B = affine hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6840
             and ind: "\<not> affine_dependent B"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6841
             and card: "of_nat (card B) = aff_dim S + 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6842
    using aff_dim_basis_exists by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6843
  then have "B \<noteq> {}" using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6844
    by (metis affine_hull_eq_empty ex_in_conv)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6845
  then obtain c where "c \<in> B" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6846
  then have "c \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6847
    by (metis aff affine_hull_eq \<open>affine S\<close> hull_inc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6848
  have xy: "x - c = y - a \<longleftrightarrow> y = x + 1 *\<^sub>R (a - c)" for x y c and a::'a
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6849
    by (auto simp: algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6850
  have *: "{x - c |x. x \<in> S} = {x - a |x. x \<in> S}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6851
    apply safe
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6852
    apply (simp_all only: xy)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6853
    using mem_affine_3_minus [OF \<open>affine S\<close>] \<open>a \<in> S\<close> \<open>c \<in> S\<close> apply blast+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6854
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6855
  have affS: "affine hull S = S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6856
    by (simp add: \<open>affine S\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6857
  have "aff_dim S = of_nat (card B) - 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6858
    using card by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6859
  also have "... = dim {x - c |x. x \<in> B}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6860
    by (simp add: affine_independent_card_dim_diffs [OF ind \<open>c \<in> B\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6861
  also have "... = dim {x - c | x. x \<in> affine hull B}"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6862
     by (simp add: diffs_affine_hull_span \<open>c \<in> B\<close> dim_span)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6863
  also have "... = dim {x - a |x. x \<in> S}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6864
     by (simp add: affS aff *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6865
   finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6866
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6867
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6868
lemma aff_dim_linear_image_le:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6869
  assumes "linear f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6870
    shows "aff_dim(f ` S) \<le> aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6871
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6872
  have "aff_dim (f ` T) \<le> aff_dim T" if "affine T" for T
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6873
  proof (cases "T = {}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6874
    case True then show ?thesis by (simp add: aff_dim_geq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6875
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6876
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6877
    then obtain a where "a \<in> T" by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6878
    have 1: "((\<lambda>x. x - f a) ` f ` T) = {x - f a |x. x \<in> f ` T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6879
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6880
    have 2: "{x - f a| x. x \<in> f ` T} = f ` {x - a| x. x \<in> T}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6881
      by (force simp: linear_diff [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6882
    have "aff_dim (f ` T) = int (dim {x - f a |x. x \<in> f ` T})"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6883
      by (simp add: \<open>a \<in> T\<close> hull_inc aff_dim_eq_dim [of "f a"] 1 cong: image_cong_simp)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6884
    also have "... = int (dim (f ` {x - a| x. x \<in> T}))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6885
      by (force simp: linear_diff [OF assms] 2)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6886
    also have "... \<le> int (dim {x - a| x. x \<in> T})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6887
      by (simp add: dim_image_le [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6888
    also have "... \<le> aff_dim T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6889
      by (simp add: aff_dim_dim_affine_diffs [symmetric] \<open>a \<in> T\<close> \<open>affine T\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6890
    finally show ?thesis .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6891
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6892
  then
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6893
  have "aff_dim (f ` (affine hull S)) \<le> aff_dim (affine hull S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6894
    using affine_affine_hull [of S] by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6895
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6896
    using affine_hull_linear_image assms linear_conv_bounded_linear by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6897
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6898
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6899
lemma aff_dim_injective_linear_image [simp]:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6900
  assumes "linear f" "inj f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6901
    shows "aff_dim (f ` S) = aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6902
proof (rule antisym)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6903
  show "aff_dim (f ` S) \<le> aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6904
    by (simp add: aff_dim_linear_image_le assms(1))
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6905
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6906
  obtain g where "linear g" "g \<circ> f = id"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6907
    using assms(1) assms(2) linear_injective_left_inverse by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6908
  then have "aff_dim S \<le> aff_dim(g ` f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6909
    by (simp add: image_comp)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6910
  also have "... \<le> aff_dim (f ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6911
    by (simp add: \<open>linear g\<close> aff_dim_linear_image_le)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6912
  finally show "aff_dim S \<le> aff_dim (f ` S)" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6913
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6914
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6915
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6916
lemma choose_affine_subset:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6917
  assumes "affine S" "-1 \<le> d" and dle: "d \<le> aff_dim S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6918
  obtains T where "affine T" "T \<subseteq> S" "aff_dim T = d"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6919
proof (cases "d = -1 \<or> S={}")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6920
  case True with assms show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6921
    by (metis aff_dim_empty affine_empty bot.extremum that eq_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6922
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6923
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6924
  with assms obtain a where "a \<in> S" "0 \<le> d" by auto
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6925
  with assms have ss: "subspace ((+) (- a) ` S)"
69661
a03a63b81f44 tuned proofs
haftmann
parents: 69618
diff changeset
  6926
    by (simp add: affine_diffs_subspace_subtract cong: image_cong_simp)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6927
  have "nat d \<le> dim ((+) (- a) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6928
    by (metis aff_dim_subspace aff_dim_translation_eq dle nat_int nat_mono ss)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6929
  then obtain T where "subspace T" and Tsb: "T \<subseteq> span ((+) (- a) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6930
                  and Tdim: "dim T = nat d"
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6931
    using choose_subspace_of_subspace [of "nat d" "(+) (- a) ` S"] by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6932
  then have "affine T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6933
    using subspace_affine by blast
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6934
  then have "affine ((+) a ` T)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6935
    by (metis affine_hull_eq affine_hull_translation)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6936
  moreover have "(+) a ` T \<subseteq> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6937
  proof -
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6938
    have "T \<subseteq> (+) (- a) ` S"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  6939
      by (metis (no_types) span_eq_iff Tsb ss)
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6940
    then show "(+) a ` T \<subseteq> S"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6941
      using add_ac by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6942
  qed
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 66884
diff changeset
  6943
  moreover have "aff_dim ((+) a ` T) = d"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6944
    by (simp add: aff_dim_subspace Tdim \<open>0 \<le> d\<close> \<open>subspace T\<close> aff_dim_translation_eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6945
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6946
    by (rule that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6947
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6948
69541
d466e0a639e4 tuned analysis manual
immler
parents: 69529
diff changeset
  6949
subsection\<open>Paracompactness\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6950
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  6951
proposition paracompact:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  6952
  fixes S :: "'a :: {metric_space,second_countable_topology} set"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6953
  assumes "S \<subseteq> \<Union>\<C>" and opC: "\<And>T. T \<in> \<C> \<Longrightarrow> open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6954
  obtains \<C>' where "S \<subseteq> \<Union> \<C>'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6955
               and "\<And>U. U \<in> \<C>' \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6956
               and "\<And>x. x \<in> S
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  6957
                       \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> \<C>' \<and> (U \<inter> V \<noteq> {})}"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  6958
proof (cases "S = {}")
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6959
  case True with that show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6960
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6961
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6962
  have "\<exists>T U. x \<in> U \<and> open U \<and> closure U \<subseteq> T \<and> T \<in> \<C>" if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6963
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6964
    obtain T where "x \<in> T" "T \<in> \<C>" "open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6965
      using assms \<open>x \<in> S\<close> by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6966
    then obtain e where "e > 0" "cball x e \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6967
      by (force simp: open_contains_cball)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6968
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6969
      apply (rule_tac x = T in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6970
      apply (rule_tac x = "ball x e" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6971
      using  \<open>T \<in> \<C>\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6972
      apply (simp add: closure_minimal)
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  6973
      using closed_cball closure_minimal by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6974
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6975
  then obtain F G where Gin: "x \<in> G x" and oG: "open (G x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6976
                    and clos: "closure (G x) \<subseteq> F x" and Fin: "F x \<in> \<C>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6977
         if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6978
    by metis
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69286
diff changeset
  6979
  then obtain \<F> where "\<F> \<subseteq> G ` S" "countable \<F>" "\<Union>\<F> = \<Union>(G ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6980
    using Lindelof [of "G ` S"] by (metis image_iff)
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69286
diff changeset
  6981
  then obtain K where K: "K \<subseteq> S" "countable K" and eq: "\<Union>(G ` K) = \<Union>(G ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6982
    by (metis countable_subset_image)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6983
  with False Gin have "K \<noteq> {}" by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6984
  then obtain a :: "nat \<Rightarrow> 'a" where "range a = K"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6985
    by (metis range_from_nat_into \<open>countable K\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6986
  then have odif: "\<And>n. open (F (a n) - \<Union>{closure (G (a m)) |m. m < n})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6987
    using \<open>K \<subseteq> S\<close> Fin opC by (fastforce simp add:)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6988
  let ?C = "range (\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6989
  have enum_S: "\<exists>n. x \<in> F(a n) \<and> x \<in> G(a n)" if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6990
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6991
    have "\<exists>y \<in> K. x \<in> G y" using eq that Gin by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6992
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6993
      using clos K \<open>range a = K\<close> closure_subset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6994
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6995
  have 1: "S \<subseteq> Union ?C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6996
  proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6997
    fix x assume "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6998
    define n where "n \<equiv> LEAST n. x \<in> F(a n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  6999
    have n: "x \<in> F(a n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7000
      using enum_S [OF \<open>x \<in> S\<close>] by (force simp: n_def intro: LeastI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7001
    have notn: "x \<notin> F(a m)" if "m < n" for m
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7002
      using that not_less_Least by (force simp: n_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7003
    then have "x \<notin> \<Union>{closure (G (a m)) |m. m < n}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7004
      using n \<open>K \<subseteq> S\<close> \<open>range a = K\<close> clos notn by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7005
    with n show "x \<in> Union ?C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7006
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7007
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7008
  have 3: "\<exists>V. open V \<and> x \<in> V \<and> finite {U. U \<in> ?C \<and> (U \<inter> V \<noteq> {})}" if "x \<in> S" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7009
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7010
    obtain n where n: "x \<in> F(a n)" "x \<in> G(a n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7011
      using \<open>x \<in> S\<close> enum_S by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7012
    have "{U \<in> ?C. U \<inter> G (a n) \<noteq> {}} \<subseteq> (\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n}) ` atMost n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7013
    proof clarsimp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7014
      fix k  assume "(F (a k) - \<Union>{closure (G (a m)) |m. m < k}) \<inter> G (a n) \<noteq> {}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7015
      then have "k \<le> n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7016
        by auto (metis closure_subset not_le subsetCE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7017
      then show "F (a k) - \<Union>{closure (G (a m)) |m. m < k}
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7018
                 \<in> (\<lambda>n. F (a n) - \<Union>{closure (G (a m)) |m. m < n}) ` {..n}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7019
        by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7020
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7021
    moreover have "finite ((\<lambda>n. F(a n) - \<Union>{closure(G(a m)) |m. m < n}) ` atMost n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7022
      by force
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7023
    ultimately have *: "finite {U \<in> ?C. U \<inter> G (a n) \<noteq> {}}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7024
      using finite_subset by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7025
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7026
      apply (rule_tac x="G (a n)" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7027
      apply (intro conjI oG n *)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7028
      using \<open>K \<subseteq> S\<close> \<open>range a = K\<close> apply blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7029
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7030
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7031
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7032
    apply (rule that [OF 1 _ 3])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7033
    using Fin \<open>K \<subseteq> S\<close> \<open>range a = K\<close>  apply (auto simp: odif)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7034
    done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7035
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7036
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7037
corollary paracompact_closedin:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  7038
  fixes S :: "'a :: {metric_space,second_countable_topology} set"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7039
  assumes cin: "closedin (top_of_set U) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7040
      and oin: "\<And>T. T \<in> \<C> \<Longrightarrow> openin (top_of_set U) T"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7041
      and "S \<subseteq> \<Union>\<C>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7042
  obtains \<C>' where "S \<subseteq> \<Union> \<C>'"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7043
               and "\<And>V. V \<in> \<C>' \<Longrightarrow> openin (top_of_set U) V \<and> (\<exists>T. T \<in> \<C> \<and> V \<subseteq> T)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7044
               and "\<And>x. x \<in> U
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7045
                       \<Longrightarrow> \<exists>V. openin (top_of_set U) V \<and> x \<in> V \<and>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7046
                               finite {X. X \<in> \<C>' \<and> (X \<inter> V \<noteq> {})}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7047
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7048
  have "\<exists>Z. open Z \<and> (T = U \<inter> Z)" if "T \<in> \<C>" for T
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7049
    using oin [OF that] by (auto simp: openin_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7050
  then obtain F where opF: "open (F T)" and intF: "U \<inter> F T = T" if "T \<in> \<C>" for T
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7051
    by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7052
  obtain K where K: "closed K" "U \<inter> K = S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7053
    using cin by (auto simp: closedin_closed)
69745
aec42cee2521 more canonical and less specialized syntax
nipkow
parents: 69712
diff changeset
  7054
  have 1: "U \<subseteq> \<Union>(insert (- K) (F ` \<C>))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7055
    by clarsimp (metis Int_iff Union_iff \<open>U \<inter> K = S\<close> \<open>S \<subseteq> \<Union>\<C>\<close> subsetD intF)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7056
  have 2: "\<And>T. T \<in> insert (- K) (F ` \<C>) \<Longrightarrow> open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7057
    using \<open>closed K\<close> by (auto simp: opF)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7058
  obtain \<D> where "U \<subseteq> \<Union>\<D>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7059
             and D1: "\<And>U. U \<in> \<D> \<Longrightarrow> open U \<and> (\<exists>T. T \<in> insert (- K) (F ` \<C>) \<and> U \<subseteq> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7060
             and D2: "\<And>x. x \<in> U \<Longrightarrow> \<exists>V. open V \<and> x \<in> V \<and> finite {U \<in> \<D>. U \<inter> V \<noteq> {}}"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  7061
    by (blast intro: paracompact [OF 1 2])
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7062
  let ?C = "{U \<inter> V |V. V \<in> \<D> \<and> (V \<inter> K \<noteq> {})}"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7063
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7064
  proof (rule_tac \<C>' = "{U \<inter> V |V. V \<in> \<D> \<and> (V \<inter> K \<noteq> {})}" in that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7065
    show "S \<subseteq> \<Union>?C"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7066
      using \<open>U \<inter> K = S\<close> \<open>U \<subseteq> \<Union>\<D>\<close> K by (blast dest!: subsetD)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7067
    show "\<And>V. V \<in> ?C \<Longrightarrow> openin (top_of_set U) V \<and> (\<exists>T. T \<in> \<C> \<and> V \<subseteq> T)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7068
      using D1 intF by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7069
    have *: "{X. (\<exists>V. X = U \<inter> V \<and> V \<in> \<D> \<and> V \<inter> K \<noteq> {}) \<and> X \<inter> (U \<inter> V) \<noteq> {}} \<subseteq>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7070
             (\<lambda>x. U \<inter> x) ` {U \<in> \<D>. U \<inter> V \<noteq> {}}" for V
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7071
      by blast
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7072
    show "\<exists>V. openin (top_of_set U) V \<and> x \<in> V \<and> finite {X \<in> ?C. X \<inter> V \<noteq> {}}"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7073
         if "x \<in> U" for x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7074
      using D2 [OF that]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7075
      apply clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7076
      apply (rule_tac x="U \<inter> V" in exI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7077
      apply (auto intro: that finite_subset [OF *])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7078
      done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7079
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7080
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7081
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7082
corollary\<^marker>\<open>tag unimportant\<close> paracompact_closed:
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  7083
  fixes S :: "'a :: {metric_space,second_countable_topology} set"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7084
  assumes "closed S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7085
      and opC: "\<And>T. T \<in> \<C> \<Longrightarrow> open T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7086
      and "S \<subseteq> \<Union>\<C>"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7087
  obtains \<C>' where "S \<subseteq> \<Union>\<C>'"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7088
               and "\<And>U. U \<in> \<C>' \<Longrightarrow> open U \<and> (\<exists>T. T \<in> \<C> \<and> U \<subseteq> T)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7089
               and "\<And>x. \<exists>V. open V \<and> x \<in> V \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7090
                               finite {U. U \<in> \<C>' \<and> (U \<inter> V \<noteq> {})}"
69918
eddcc7c726f3 new material;' strengthened material; moved proofs out of Function_Topology in order to lessen its dependencies
paulson <lp15@cam.ac.uk>
parents: 69745
diff changeset
  7091
  by (rule paracompact_closedin [of UNIV S \<C>]) (auto simp: assms)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7092
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7093
  
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7094
subsection\<^marker>\<open>tag unimportant\<close>\<open>Closed-graph characterization of continuity\<close>
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7095
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7096
lemma continuous_closed_graph_gen:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7097
  fixes T :: "'b::real_normed_vector set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7098
  assumes contf: "continuous_on S f" and fim: "f ` S \<subseteq> T"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7099
    shows "closedin (top_of_set (S \<times> T)) ((\<lambda>x. Pair x (f x)) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7100
proof -
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  7101
  have eq: "((\<lambda>x. Pair x (f x)) ` S) =(S \<times> T \<inter> (\<lambda>z. (f \<circ> fst)z - snd z) -` {0})"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7102
    using fim by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7103
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7104
    apply (subst eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7105
    apply (intro continuous_intros continuous_closedin_preimage continuous_on_subset [OF contf])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7106
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7107
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7108
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7109
lemma continuous_closed_graph_eq:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7110
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7111
  assumes "compact T" and fim: "f ` S \<subseteq> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7112
  shows "continuous_on S f \<longleftrightarrow>
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7113
         closedin (top_of_set (S \<times> T)) ((\<lambda>x. Pair x (f x)) ` S)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7114
         (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7115
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7116
  have "?lhs" if ?rhs
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7117
  proof (clarsimp simp add: continuous_on_closed_gen [OF fim])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7118
    fix U
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7119
    assume U: "closedin (top_of_set T) U"
66884
c2128ab11f61 Switching to inverse image and constant_on, plus some new material
paulson <lp15@cam.ac.uk>
parents: 66793
diff changeset
  7120
    have eq: "(S \<inter> f -` U) = fst ` (((\<lambda>x. Pair x (f x)) ` S) \<inter> (S \<times> U))"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7121
      by (force simp: image_iff)
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7122
    show "closedin (top_of_set S) (S \<inter> f -` U)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7123
      by (simp add: U closedin_Int closedin_Times closed_map_fst [OF \<open>compact T\<close>] that eq)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7124
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7125
  with continuous_closed_graph_gen assms show ?thesis by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7126
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7127
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7128
lemma continuous_closed_graph:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7129
  fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7130
  assumes "closed S" and contf: "continuous_on S f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7131
  shows "closed ((\<lambda>x. Pair x (f x)) ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7132
  apply (rule closedin_closed_trans)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7133
   apply (rule continuous_closed_graph_gen [OF contf subset_UNIV])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7134
  by (simp add: \<open>closed S\<close> closed_Times)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7135
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7136
lemma continuous_from_closed_graph:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7137
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7138
  assumes "compact T" and fim: "f ` S \<subseteq> T" and clo: "closed ((\<lambda>x. Pair x (f x)) ` S)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7139
  shows "continuous_on S f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7140
    using fim clo
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7141
    by (auto intro: closed_subset simp: continuous_closed_graph_eq [OF \<open>compact T\<close> fim])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7142
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7143
lemma continuous_on_Un_local_open:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7144
  assumes opS: "openin (top_of_set (S \<union> T)) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7145
      and opT: "openin (top_of_set (S \<union> T)) T"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7146
      and contf: "continuous_on S f" and contg: "continuous_on T f"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7147
    shows "continuous_on (S \<union> T) f"
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7148
  using pasting_lemma [of "{S,T}" "top_of_set (S \<union> T)" id euclidean "\<lambda>i. f" f] contf contg opS opT
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7149
  by (simp add: subtopology_subtopology) (metis inf.absorb2 openin_imp_subset)  
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7150
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7151
lemma continuous_on_cases_local_open:
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7152
  assumes opS: "openin (top_of_set (S \<union> T)) S"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7153
      and opT: "openin (top_of_set (S \<union> T)) T"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7154
      and contf: "continuous_on S f" and contg: "continuous_on T g"
69508
2a4c8a2a3f8e tuned headers; ~ -> \<not>
nipkow
parents: 69325
diff changeset
  7155
      and fg: "\<And>x. x \<in> S \<and> \<not>P x \<or> x \<in> T \<and> P x \<Longrightarrow> f x = g x"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7156
    shows "continuous_on (S \<union> T) (\<lambda>x. if P x then f x else g x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7157
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7158
  have "\<And>x. x \<in> S \<Longrightarrow> (if P x then f x else g x) = f x"  "\<And>x. x \<in> T \<Longrightarrow> (if P x then f x else g x) = g x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7159
    by (simp_all add: fg)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7160
  then have "continuous_on S (\<lambda>x. if P x then f x else g x)" "continuous_on T (\<lambda>x. if P x then f x else g x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7161
    by (simp_all add: contf contg cong: continuous_on_cong)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7162
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7163
    by (rule continuous_on_Un_local_open [OF opS opT])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7164
qed
69922
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7165
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7166
lemma continuous_map_cases_le:
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7167
  assumes contp: "continuous_map X euclideanreal p"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7168
    and contq: "continuous_map X euclideanreal q"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7169
    and contf: "continuous_map (subtopology X {x. x \<in> topspace X \<and> p x \<le> q x}) Y f"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7170
    and contg: "continuous_map (subtopology X {x. x \<in> topspace X \<and> q x \<le> p x}) Y g"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7171
    and fg: "\<And>x. \<lbrakk>x \<in> topspace X; p x = q x\<rbrakk> \<Longrightarrow> f x = g x"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7172
  shows "continuous_map X Y (\<lambda>x. if p x \<le> q x then f x else g x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7173
proof -
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7174
  have "continuous_map X Y (\<lambda>x. if q x - p x \<in> {0..} then f x else g x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7175
  proof (rule continuous_map_cases_function)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7176
    show "continuous_map X euclideanreal (\<lambda>x. q x - p x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7177
      by (intro contp contq continuous_intros)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7178
    show "continuous_map (subtopology X {x \<in> topspace X. q x - p x \<in> euclideanreal closure_of {0..}}) Y f"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7179
      by (simp add: contf)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7180
    show "continuous_map (subtopology X {x \<in> topspace X. q x - p x \<in> euclideanreal closure_of (topspace euclideanreal - {0..})}) Y g"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7181
      by (simp add: contg flip: Compl_eq_Diff_UNIV)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7182
  qed (auto simp: fg)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7183
  then show ?thesis
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7184
    by simp
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7185
qed
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7186
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7187
lemma continuous_map_cases_lt:
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7188
  assumes contp: "continuous_map X euclideanreal p"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7189
    and contq: "continuous_map X euclideanreal q"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7190
    and contf: "continuous_map (subtopology X {x. x \<in> topspace X \<and> p x \<le> q x}) Y f"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7191
    and contg: "continuous_map (subtopology X {x. x \<in> topspace X \<and> q x \<le> p x}) Y g"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7192
    and fg: "\<And>x. \<lbrakk>x \<in> topspace X; p x = q x\<rbrakk> \<Longrightarrow> f x = g x"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7193
  shows "continuous_map X Y (\<lambda>x. if p x < q x then f x else g x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7194
proof -
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7195
  have "continuous_map X Y (\<lambda>x. if q x - p x \<in> {0<..} then f x else g x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7196
  proof (rule continuous_map_cases_function)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7197
    show "continuous_map X euclideanreal (\<lambda>x. q x - p x)"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7198
      by (intro contp contq continuous_intros)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7199
    show "continuous_map (subtopology X {x \<in> topspace X. q x - p x \<in> euclideanreal closure_of {0<..}}) Y f"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7200
      by (simp add: contf)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7201
    show "continuous_map (subtopology X {x \<in> topspace X. q x - p x \<in> euclideanreal closure_of (topspace euclideanreal - {0<..})}) Y g"
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7202
      by (simp add: contg flip: Compl_eq_Diff_UNIV)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7203
  qed (auto simp: fg)
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7204
  then show ?thesis
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7205
    by simp
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7206
qed
4a9167f377b0 new material about topology, etc.; also fixes for yesterday's
paulson <lp15@cam.ac.uk>
parents: 69918
diff changeset
  7207
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7208
subsection\<^marker>\<open>tag unimportant\<close>\<open>The union of two collinear segments is another segment\<close>
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7209
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7210
proposition\<^marker>\<open>tag unimportant\<close> in_convex_hull_exchange:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7211
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7212
  assumes a: "a \<in> convex hull S" and xS: "x \<in> convex hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7213
  obtains b where "b \<in> S" "x \<in> convex hull (insert a (S - {b}))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7214
proof (cases "a \<in> S")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7215
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7216
  with xS insert_Diff that  show ?thesis by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7217
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7218
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7219
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7220
  proof (cases "finite S \<and> card S \<le> Suc (DIM('a))")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7221
    case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7222
    then obtain u where u0: "\<And>i. i \<in> S \<Longrightarrow> 0 \<le> u i" and u1: "sum u S = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7223
                    and ua: "(\<Sum>i\<in>S. u i *\<^sub>R i) = a"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7224
        using a by (auto simp: convex_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7225
    obtain v where v0: "\<And>i. i \<in> S \<Longrightarrow> 0 \<le> v i" and v1: "sum v S = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7226
               and vx: "(\<Sum>i\<in>S. v i *\<^sub>R i) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7227
      using True xS by (auto simp: convex_hull_finite)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7228
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7229
    proof (cases "\<exists>b. b \<in> S \<and> v b = 0")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7230
      case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7231
      then obtain b where b: "b \<in> S" "v b = 0"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7232
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7233
      show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7234
      proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7235
        have fin: "finite (insert a (S - {b}))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7236
          using sum.infinite v1 by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7237
        show "x \<in> convex hull insert a (S - {b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7238
          unfolding convex_hull_finite [OF fin] mem_Collect_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7239
        proof (intro conjI exI ballI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7240
          have "(\<Sum>x \<in> insert a (S - {b}). if x = a then 0 else v x) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7241
                (\<Sum>x \<in> S - {b}. if x = a then 0 else v x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7242
            apply (rule sum.mono_neutral_right)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7243
            using fin by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7244
          also have "... = (\<Sum>x \<in> S - {b}. v x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7245
            using b False by (auto intro!: sum.cong split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7246
          also have "... = (\<Sum>x\<in>S. v x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7247
            by (metis \<open>v b = 0\<close> diff_zero sum.infinite sum_diff1 u1 zero_neq_one)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7248
          finally show "(\<Sum>x\<in>insert a (S - {b}). if x = a then 0 else v x) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7249
            by (simp add: v1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7250
          show "\<And>x. x \<in> insert a (S - {b}) \<Longrightarrow> 0 \<le> (if x = a then 0 else v x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7251
            by (auto simp: v0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7252
          have "(\<Sum>x \<in> insert a (S - {b}). (if x = a then 0 else v x) *\<^sub>R x) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7253
                (\<Sum>x \<in> S - {b}. (if x = a then 0 else v x) *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7254
            apply (rule sum.mono_neutral_right)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7255
            using fin by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7256
          also have "... = (\<Sum>x \<in> S - {b}. v x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7257
            using b False by (auto intro!: sum.cong split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7258
          also have "... = (\<Sum>x\<in>S. v x *\<^sub>R x)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7259
            by (metis (no_types, lifting) b(2) diff_zero fin finite.emptyI finite_Diff2 finite_insert scale_eq_0_iff sum_diff1)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7260
          finally show "(\<Sum>x\<in>insert a (S - {b}). (if x = a then 0 else v x) *\<^sub>R x) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7261
            by (simp add: vx)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7262
        qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7263
      qed (rule \<open>b \<in> S\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7264
    next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7265
      case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7266
      have le_Max: "u i / v i \<le> Max ((\<lambda>i. u i / v i) ` S)" if "i \<in> S" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7267
        by (simp add: True that)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7268
      have "Max ((\<lambda>i. u i / v i) ` S) \<in> (\<lambda>i. u i / v i) ` S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7269
        using True v1 by (auto intro: Max_in)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7270
      then obtain b where "b \<in> S" and beq: "Max ((\<lambda>b. u b / v b) ` S) = u b / v b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7271
        by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7272
      then have "0 \<noteq> u b / v b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7273
        using le_Max beq divide_le_0_iff le_numeral_extra(2) sum_nonpos u1
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7274
        by (metis False eq_iff v0)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7275
      then have  "0 < u b" "0 < v b"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7276
        using False \<open>b \<in> S\<close> u0 v0 by force+
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7277
      have fin: "finite (insert a (S - {b}))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7278
        using sum.infinite v1 by fastforce
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7279
      show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7280
      proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7281
        show "x \<in> convex hull insert a (S - {b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7282
          unfolding convex_hull_finite [OF fin] mem_Collect_eq
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7283
        proof (intro conjI exI ballI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7284
          have "(\<Sum>x \<in> insert a (S - {b}). if x=a then v b / u b else v x - (v b / u b) * u x) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7285
                v b / u b + (\<Sum>x \<in> S - {b}. v x - (v b / u b) * u x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7286
            using \<open>a \<notin> S\<close> \<open>b \<in> S\<close> True  apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7287
            apply (rule sum.cong, auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7288
            done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7289
          also have "... = v b / u b + (\<Sum>x \<in> S - {b}. v x) - (v b / u b) * (\<Sum>x \<in> S - {b}. u x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7290
            by (simp add: Groups_Big.sum_subtractf sum_distrib_left)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7291
          also have "... = (\<Sum>x\<in>S. v x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7292
            using \<open>0 < u b\<close> True  by (simp add: Groups_Big.sum_diff1 u1 field_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7293
          finally show "sum (\<lambda>x. if x=a then v b / u b else v x - (v b / u b) * u x) (insert a (S - {b})) = 1"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7294
            by (simp add: v1)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7295
          show "0 \<le> (if i = a then v b / u b else v i - v b / u b * u i)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7296
            if "i \<in> insert a (S - {b})" for i
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7297
            using \<open>0 < u b\<close> \<open>0 < v b\<close> v0 [of i] le_Max [of i] beq that False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7298
            by (auto simp: field_simps split: if_split_asm)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7299
          have "(\<Sum>x\<in>insert a (S - {b}). (if x=a then v b / u b else v x - v b / u b * u x) *\<^sub>R x) =
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7300
                (v b / u b) *\<^sub>R a + (\<Sum>x\<in>S - {b}. (v x - v b / u b * u x) *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7301
            using \<open>a \<notin> S\<close> \<open>b \<in> S\<close> True  apply simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7302
            apply (rule sum.cong, auto)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7303
            done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7304
          also have "... = (v b / u b) *\<^sub>R a + (\<Sum>x \<in> S - {b}. v x *\<^sub>R x) - (v b / u b) *\<^sub>R (\<Sum>x \<in> S - {b}. u x *\<^sub>R x)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7305
            by (simp add: Groups_Big.sum_subtractf scaleR_left_diff_distrib sum_distrib_left scale_sum_right)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7306
          also have "... = (\<Sum>x\<in>S. v x *\<^sub>R x)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7307
            using \<open>0 < u b\<close> True  by (simp add: ua vx Groups_Big.sum_diff1 algebra_simps)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7308
          finally
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7309
          show "(\<Sum>x\<in>insert a (S - {b}). (if x=a then v b / u b else v x - v b / u b * u x) *\<^sub>R x) = x"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7310
            by (simp add: vx)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7311
        qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7312
      qed (rule \<open>b \<in> S\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7313
    qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7314
  next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7315
    case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7316
    obtain T where "finite T" "T \<subseteq> S" and caT: "card T \<le> Suc (DIM('a))" and xT: "x \<in> convex hull T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7317
      using xS by (auto simp: caratheodory [of S])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7318
    with False obtain b where b: "b \<in> S" "b \<notin> T"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7319
      by (metis antisym subsetI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7320
    show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7321
    proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7322
      show "x \<in> convex hull insert a (S - {b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7323
        using  \<open>T \<subseteq> S\<close> b by (blast intro: subsetD [OF hull_mono xT])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7324
    qed (rule \<open>b \<in> S\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7325
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7326
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7327
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7328
lemma convex_hull_exchange_Union:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7329
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7330
  assumes "a \<in> convex hull S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7331
  shows "convex hull S = (\<Union>b \<in> S. convex hull (insert a (S - {b})))" (is "?lhs = ?rhs")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7332
proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7333
  show "?lhs \<subseteq> ?rhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7334
    by (blast intro: in_convex_hull_exchange [OF assms])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7335
  show "?rhs \<subseteq> ?lhs"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7336
  proof clarify
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7337
    fix x b
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7338
    assume"b \<in> S" "x \<in> convex hull insert a (S - {b})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7339
    then show "x \<in> convex hull S" if "b \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7340
      by (metis (no_types) that assms order_refl hull_mono hull_redundant insert_Diff_single insert_subset subsetCE)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7341
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7342
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7343
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7344
lemma Un_closed_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7345
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7346
  assumes "b \<in> closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7347
    shows "closed_segment a b \<union> closed_segment b c = closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7348
proof (cases "c = a")
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7349
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7350
  with assms show ?thesis by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7351
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7352
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7353
  with assms have "convex hull {a, b} \<union> convex hull {b, c} = (\<Union>ba\<in>{a, c}. convex hull insert b ({a, c} - {ba}))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7354
    by (auto simp: insert_Diff_if insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7355
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7356
    using convex_hull_exchange_Union
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7357
    by (metis assms segment_convex_hull)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7358
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7359
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7360
lemma Un_open_segment:
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7361
  fixes a :: "'a::euclidean_space"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7362
  assumes "b \<in> open_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7363
  shows "open_segment a b \<union> {b} \<union> open_segment b c = open_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7364
proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7365
  have b: "b \<in> closed_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7366
    by (simp add: assms open_closed_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7367
  have *: "open_segment a c \<subseteq> insert b (open_segment a b \<union> open_segment b c)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7368
          if "{b,c,a} \<union> open_segment a b \<union> open_segment b c = {c,a} \<union> open_segment a c"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7369
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7370
    have "insert a (insert c (insert b (open_segment a b \<union> open_segment b c))) = insert a (insert c (open_segment a c))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7371
      using that by (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7372
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7373
      by (metis (no_types) Diff_cancel Diff_eq_empty_iff Diff_insert2 open_segment_def)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7374
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7375
  show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7376
    using Un_closed_segment [OF b]
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7377
    apply (simp add: closed_segment_eq_open)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7378
      apply (rule equalityI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7379
    using assms
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7380
     apply (simp add: b subset_open_segment)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7381
      using * by (simp add: insert_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7382
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7383
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7384
subsection\<open>Covering an open set by a countable chain of compact sets\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7385
  
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  7386
proposition open_Union_compact_subsets:
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7387
  fixes S :: "'a::euclidean_space set"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7388
  assumes "open S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7389
  obtains C where "\<And>n. compact(C n)" "\<And>n. C n \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7390
                  "\<And>n. C n \<subseteq> interior(C(Suc n))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7391
                  "\<Union>(range C) = S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7392
                  "\<And>K. \<lbrakk>compact K; K \<subseteq> S\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. K \<subseteq> (C n)"
68607
67bb59e49834 make theorem, corollary, and proposition %important for HOL-Analysis manual
immler
parents: 68527
diff changeset
  7393
proof (cases "S = {}")
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7394
  case True
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7395
  then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7396
    by (rule_tac C = "\<lambda>n. {}" in that) auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7397
next
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7398
  case False
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7399
  then obtain a where "a \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7400
    by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7401
  let ?C = "\<lambda>n. cball a (real n) - (\<Union>x \<in> -S. \<Union>e \<in> ball 0 (1 / real(Suc n)). {x + e})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7402
  have "\<exists>N. \<forall>n\<ge>N. K \<subseteq> (f n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7403
        if "\<And>n. compact(f n)" and sub_int: "\<And>n. f n \<subseteq> interior (f(Suc n))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7404
            and eq: "\<Union>(range f) = S" and "compact K" "K \<subseteq> S" for f K
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7405
  proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7406
    have *: "\<forall>n. f n \<subseteq> (\<Union>n. interior (f n))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7407
      by (meson Sup_upper2 UNIV_I \<open>\<And>n. f n \<subseteq> interior (f (Suc n))\<close> image_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7408
    have mono: "\<And>m n. m \<le> n \<Longrightarrow>f m \<subseteq> f n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7409
      by (meson dual_order.trans interior_subset lift_Suc_mono_le sub_int)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7410
    obtain I where "finite I" and I: "K \<subseteq> (\<Union>i\<in>I. interior (f i))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7411
    proof (rule compactE_image [OF \<open>compact K\<close>])
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7412
      show "K \<subseteq> (\<Union>n. interior (f n))"
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69286
diff changeset
  7413
        using \<open>K \<subseteq> S\<close> \<open>\<Union>(f ` UNIV) = S\<close> * by blast
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7414
    qed auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7415
    { fix n
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7416
      assume n: "Max I \<le> n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7417
      have "(\<Union>i\<in>I. interior (f i)) \<subseteq> f n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7418
        by (rule UN_least) (meson dual_order.trans interior_subset mono I Max_ge [OF \<open>finite I\<close>] n)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7419
      then have "K \<subseteq> f n"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7420
        using I by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7421
    }
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7422
    then show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7423
      by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7424
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7425
  moreover have "\<exists>f. (\<forall>n. compact(f n)) \<and> (\<forall>n. (f n) \<subseteq> S) \<and> (\<forall>n. (f n) \<subseteq> interior(f(Suc n))) \<and>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7426
                     ((\<Union>(range f) = S))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7427
  proof (intro exI conjI allI)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7428
    show "\<And>n. compact (?C n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7429
      by (auto simp: compact_diff open_sums)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7430
    show "\<And>n. ?C n \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7431
      by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7432
    show "?C n \<subseteq> interior (?C (Suc n))" for n
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7433
    proof (simp add: interior_diff, rule Diff_mono)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7434
      show "cball a (real n) \<subseteq> ball a (1 + real n)"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7435
        by (simp add: cball_subset_ball_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7436
      have cl: "closed (\<Union>x\<in>- S. \<Union>e\<in>cball 0 (1 / (2 + real n)). {x + e})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7437
        using assms by (auto intro: closed_compact_sums)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7438
      have "closure (\<Union>x\<in>- S. \<Union>y\<in>ball 0 (1 / (2 + real n)). {x + y})
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7439
            \<subseteq> (\<Union>x \<in> -S. \<Union>e \<in> cball 0 (1 / (2 + real n)). {x + e})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7440
        by (intro closure_minimal UN_mono ball_subset_cball order_refl cl)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7441
      also have "... \<subseteq> (\<Union>x \<in> -S. \<Union>y\<in>ball 0 (1 / (1 + real n)). {x + y})"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7442
        apply (intro UN_mono order_refl)
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  7443
        apply (simp add: cball_subset_ball_iff field_split_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7444
        done
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7445
      finally show "closure (\<Union>x\<in>- S. \<Union>y\<in>ball 0 (1 / (2 + real n)). {x + y})
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7446
                    \<subseteq> (\<Union>x \<in> -S. \<Union>y\<in>ball 0 (1 / (1 + real n)). {x + y})" .
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7447
    qed
69325
4b6ddc5989fc removed legacy input syntax
haftmann
parents: 69313
diff changeset
  7448
    have "S \<subseteq> \<Union> (range ?C)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7449
    proof
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7450
      fix x
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7451
      assume x: "x \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7452
      then obtain e where "e > 0" and e: "ball x e \<subseteq> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7453
        using assms open_contains_ball by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7454
      then obtain N1 where "N1 > 0" and N1: "real N1 > 1/e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7455
        using reals_Archimedean2
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7456
        by (metis divide_less_0_iff less_eq_real_def neq0_conv not_le of_nat_0 of_nat_1 of_nat_less_0_iff)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7457
      obtain N2 where N2: "norm(x - a) \<le> real N2"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7458
        by (meson real_arch_simple)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7459
      have N12: "inverse((N1 + N2) + 1) \<le> inverse(N1)"
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70802
diff changeset
  7460
        using \<open>N1 > 0\<close> by (auto simp: field_split_simps)
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7461
      have "x \<noteq> y + z" if "y \<notin> S" "norm z < 1 / (1 + (real N1 + real N2))" for y z
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7462
      proof -
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7463
        have "e * real N1 < e * (1 + (real N1 + real N2))"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7464
          by (simp add: \<open>0 < e\<close>)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7465
        then have "1 / (1 + (real N1 + real N2)) < e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7466
          using N1 \<open>e > 0\<close>
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7467
          by (metis divide_less_eq less_trans mult.commute of_nat_add of_nat_less_0_iff of_nat_Suc)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7468
        then have "x - z \<in> ball x e"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7469
          using that by simp
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7470
        then have "x - z \<in> S"
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7471
          using e by blast
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7472
        with that show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7473
          by auto
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7474
      qed
69325
4b6ddc5989fc removed legacy input syntax
haftmann
parents: 69313
diff changeset
  7475
      with N2 show "x \<in> \<Union> (range ?C)"
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7476
        by (rule_tac a = "N1+N2" in UN_I) (auto simp: dist_norm norm_minus_commute)
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7477
    qed
69325
4b6ddc5989fc removed legacy input syntax
haftmann
parents: 69313
diff changeset
  7478
    then show "\<Union> (range ?C) = S" by auto
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7479
  qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7480
  ultimately show ?thesis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7481
    using that by metis
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7482
qed
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7483
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7484
69272
15e9ed5b28fb isabelle update_cartouches -t;
wenzelm
parents: 69064
diff changeset
  7485
subsection\<open>Orthogonal complement\<close>
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7486
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7487
definition\<^marker>\<open>tag important\<close> orthogonal_comp ("_\<^sup>\<bottom>" [80] 80)
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7488
  where "orthogonal_comp W \<equiv> {x. \<forall>y \<in> W. orthogonal y x}"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7489
69541
d466e0a639e4 tuned analysis manual
immler
parents: 69529
diff changeset
  7490
proposition subspace_orthogonal_comp: "subspace (W\<^sup>\<bottom>)"
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7491
  unfolding subspace_def orthogonal_comp_def orthogonal_def
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7492
  by (auto simp: inner_right_distrib)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7493
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7494
lemma orthogonal_comp_anti_mono:
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7495
  assumes "A \<subseteq> B"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7496
  shows "B\<^sup>\<bottom> \<subseteq> A\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7497
proof
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7498
  fix x assume x: "x \<in> B\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7499
  show "x \<in> orthogonal_comp A" using x unfolding orthogonal_comp_def
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7500
    by (simp add: orthogonal_def, metis assms in_mono)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7501
qed
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7502
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7503
lemma orthogonal_comp_null [simp]: "{0}\<^sup>\<bottom> = UNIV"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7504
  by (auto simp: orthogonal_comp_def orthogonal_def)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7505
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7506
lemma orthogonal_comp_UNIV [simp]: "UNIV\<^sup>\<bottom> = {0}"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7507
  unfolding orthogonal_comp_def orthogonal_def
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7508
  by auto (use inner_eq_zero_iff in blast)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7509
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7510
lemma orthogonal_comp_subset: "U \<subseteq> U\<^sup>\<bottom>\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7511
  by (auto simp: orthogonal_comp_def orthogonal_def inner_commute)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7512
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7513
lemma subspace_sum_minimal:
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7514
  assumes "S \<subseteq> U" "T \<subseteq> U" "subspace U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7515
  shows "S + T \<subseteq> U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7516
proof
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7517
  fix x
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7518
  assume "x \<in> S + T"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7519
  then obtain xs xt where "xs \<in> S" "xt \<in> T" "x = xs+xt"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7520
    by (meson set_plus_elim)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7521
  then show "x \<in> U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7522
    by (meson assms subsetCE subspace_add)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7523
qed
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7524
69541
d466e0a639e4 tuned analysis manual
immler
parents: 69529
diff changeset
  7525
proposition subspace_sum_orthogonal_comp:
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7526
  fixes U :: "'a :: euclidean_space set"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7527
  assumes "subspace U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7528
  shows "U + U\<^sup>\<bottom> = UNIV"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7529
proof -
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7530
  obtain B where "B \<subseteq> U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7531
    and ortho: "pairwise orthogonal B" "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7532
    and "independent B" "card B = dim U" "span B = U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7533
    using orthonormal_basis_subspace [OF assms] by metis
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7534
  then have "finite B"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7535
    by (simp add: indep_card_eq_dim_span)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7536
  have *: "\<forall>x\<in>B. \<forall>y\<in>B. x \<bullet> y = (if x=y then 1 else 0)"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7537
    using ortho norm_eq_1 by (auto simp: orthogonal_def pairwise_def)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7538
  { fix v
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7539
    let ?u = "\<Sum>b\<in>B. (v \<bullet> b) *\<^sub>R b"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7540
    have "v = ?u + (v - ?u)"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7541
      by simp
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7542
    moreover have "?u \<in> U"
68074
8d50467f7555 fixed HOL-Analysis
immler
parents: 68073
diff changeset
  7543
      by (metis (no_types, lifting) \<open>span B = U\<close> assms subspace_sum span_base span_mul)
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7544
    moreover have "(v - ?u) \<in> U\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7545
    proof (clarsimp simp: orthogonal_comp_def orthogonal_def)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7546
      fix y
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7547
      assume "y \<in> U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7548
      with \<open>span B = U\<close> span_finite [OF \<open>finite B\<close>]
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7549
      obtain u where u: "y = (\<Sum>b\<in>B. u b *\<^sub>R b)"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7550
        by auto
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7551
      have "b \<bullet> (v - ?u) = 0" if "b \<in> B" for b
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7552
        using that \<open>finite B\<close>
69064
5840724b1d71 Prefix form of infix with * on either side no longer needs special treatment
nipkow
parents: 68796
diff changeset
  7553
        by (simp add: * algebra_simps inner_sum_right if_distrib [of "(*)v" for v] inner_commute cong: if_cong)
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7554
      then show "y \<bullet> (v - ?u) = 0"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7555
        by (simp add: u inner_sum_left)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7556
    qed
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7557
    ultimately have "v \<in> U + U\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7558
      using set_plus_intro by fastforce
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7559
  } then show ?thesis
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7560
    by auto
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7561
qed
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7562
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7563
lemma orthogonal_Int_0:
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7564
  assumes "subspace U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7565
  shows "U \<inter> U\<^sup>\<bottom> = {0}"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7566
  using orthogonal_comp_def orthogonal_self
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7567
  by (force simp: assms subspace_0 subspace_orthogonal_comp)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7568
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7569
lemma orthogonal_comp_self:
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7570
  fixes U :: "'a :: euclidean_space set"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7571
  assumes "subspace U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7572
  shows "U\<^sup>\<bottom>\<^sup>\<bottom> = U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7573
proof
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7574
  have ssU': "subspace (U\<^sup>\<bottom>)"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7575
    by (simp add: subspace_orthogonal_comp)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7576
  have "u \<in> U" if "u \<in> U\<^sup>\<bottom>\<^sup>\<bottom>" for u
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7577
  proof -
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7578
    obtain v w where "u = v+w" "v \<in> U" "w \<in> U\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7579
      using subspace_sum_orthogonal_comp [OF assms] set_plus_elim by blast
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7580
    then have "u-v \<in> U\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7581
      by simp
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7582
    moreover have "v \<in> U\<^sup>\<bottom>\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7583
      using \<open>v \<in> U\<close> orthogonal_comp_subset by blast
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7584
    then have "u-v \<in> U\<^sup>\<bottom>\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7585
      by (simp add: subspace_diff subspace_orthogonal_comp that)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7586
    ultimately have "u-v = 0"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7587
      using orthogonal_Int_0 ssU' by blast
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7588
    with \<open>v \<in> U\<close> show ?thesis
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7589
      by auto
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7590
  qed
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7591
  then show "U\<^sup>\<bottom>\<^sup>\<bottom> \<subseteq> U"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7592
    by auto
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7593
qed (use orthogonal_comp_subset in auto)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7594
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7595
lemma ker_orthogonal_comp_adjoint:
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7596
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7597
  assumes "linear f"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7598
  shows "f -` {0} =  (range (adjoint f))\<^sup>\<bottom>"
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7599
  apply (auto simp: orthogonal_comp_def orthogonal_def)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7600
  apply (simp add: adjoint_works assms(1) inner_commute)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7601
  by (metis adjoint_works all_zero_iff assms(1) inner_commute)
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7602
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69922
diff changeset
  7603
subsection\<^marker>\<open>tag unimportant\<close> \<open>A non-injective linear function maps into a hyperplane.\<close>
67989
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7604
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7605
lemma linear_surj_adj_imp_inj:
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7606
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7607
  assumes "linear f" "surj (adjoint f)"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7608
  shows "inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7609
proof -
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7610
  have "\<exists>x. y = adjoint f x" for y
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7611
    using assms by (simp add: surjD)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7612
  then show "inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7613
    using assms unfolding inj_on_def image_def
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7614
    by (metis (no_types) adjoint_works euclidean_eqI)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7615
qed
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7616
70138
bd42cc1e10d0 formal URLs;
wenzelm
parents: 70136
diff changeset
  7617
\<comment> \<open>\<^url>\<open>https://mathonline.wikidot.com/injectivity-and-surjectivity-of-the-adjoint-of-a-linear-map\<close>\<close>
67989
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7618
lemma surj_adjoint_iff_inj [simp]:
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7619
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7620
  assumes "linear f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7621
  shows  "surj (adjoint f) \<longleftrightarrow> inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7622
proof
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7623
  assume "surj (adjoint f)"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7624
  then show "inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7625
    by (simp add: assms linear_surj_adj_imp_inj)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7626
next
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7627
  assume "inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7628
  have "f -` {0} = {0}"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7629
    using assms \<open>inj f\<close> linear_0 linear_injective_0 by fastforce
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7630
  moreover have "f -` {0} = range (adjoint f)\<^sup>\<bottom>"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7631
    by (intro ker_orthogonal_comp_adjoint assms)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7632
  ultimately have "range (adjoint f)\<^sup>\<bottom>\<^sup>\<bottom> = UNIV"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7633
    by (metis orthogonal_comp_null)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7634
  then show "surj (adjoint f)"
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7635
    using adjoint_linear \<open>linear f\<close>
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7636
    by (subst (asm) orthogonal_comp_self)
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7637
      (simp add: adjoint_linear linear_subspace_image)
67989
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7638
qed
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7639
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7640
lemma inj_adjoint_iff_surj [simp]:
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7641
  fixes f :: "'m::euclidean_space \<Rightarrow> 'n::euclidean_space"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7642
  assumes "linear f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7643
  shows  "inj (adjoint f) \<longleftrightarrow> surj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7644
proof
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7645
  assume "inj (adjoint f)"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7646
  have "(adjoint f) -` {0} = {0}"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7647
    by (metis \<open>inj (adjoint f)\<close> adjoint_linear assms surj_adjoint_iff_inj ker_orthogonal_comp_adjoint orthogonal_comp_UNIV)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7648
  then have "(range(f))\<^sup>\<bottom> = {0}"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7649
    by (metis (no_types, hide_lams) adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint set_zero)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7650
  then show "surj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7651
    by (metis \<open>inj (adjoint f)\<close> adjoint_adjoint adjoint_linear assms surj_adjoint_iff_inj)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7652
next
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7653
  assume "surj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7654
  then have "range f = (adjoint f -` {0})\<^sup>\<bottom>"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7655
    by (simp add: adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7656
  then have "{0} = adjoint f -` {0}"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7657
    using \<open>surj f\<close> adjoint_adjoint adjoint_linear assms ker_orthogonal_comp_adjoint by force
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7658
  then show "inj (adjoint f)"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7659
    by (simp add: \<open>surj f\<close> adjoint_adjoint adjoint_linear assms linear_surj_adj_imp_inj)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7660
qed
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7661
69541
d466e0a639e4 tuned analysis manual
immler
parents: 69529
diff changeset
  7662
lemma linear_singular_into_hyperplane:
67989
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7663
  fixes f :: "'n::euclidean_space \<Rightarrow> 'n"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7664
  assumes "linear f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7665
  shows "\<not> inj f \<longleftrightarrow> (\<exists>a. a \<noteq> 0 \<and> (\<forall>x. a \<bullet> f x = 0))" (is "_ = ?rhs")
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7666
proof
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7667
  assume "\<not>inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7668
  then show ?rhs
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7669
    using all_zero_iff
68072
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7670
    by (metis (no_types, hide_lams) adjoint_clauses(2) adjoint_linear assms
493b818e8e10 added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents: 67990
diff changeset
  7671
        linear_injective_0 linear_injective_imp_surjective linear_surj_adj_imp_inj)
67989
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7672
next
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7673
  assume ?rhs
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7674
  then show "\<not>inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7675
    by (metis assms linear_injective_isomorphism all_zero_iff)
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7676
qed
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7677
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7678
lemma linear_singular_image_hyperplane:
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7679
  fixes f :: "'n::euclidean_space \<Rightarrow> 'n"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7680
  assumes "linear f" "\<not>inj f"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7681
  obtains a where "a \<noteq> 0" "\<And>S. f ` S \<subseteq> {x. a \<bullet> x = 0}"
706f86afff43 more results about measure and negligibility
paulson <lp15@cam.ac.uk>
parents: 67986
diff changeset
  7682
  using assms by (fastforce simp add: linear_singular_into_hyperplane)
67986
b65c4a6a015e quite a few more results about negligibility, etc., and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents: 67968
diff changeset
  7683
66289
2562f151541c Divided Convex_Euclidean_Space.thy in half, creating new theory Starlike
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  7684
end