src/HOL/Multivariate_Analysis/Ordered_Euclidean_Space.thy
changeset 56166 9a241bc276cd
parent 55413 a8e96847523c
child 56188 0268784f60da
equal deleted inserted replaced
56165:dd89ce51d2c8 56166:9a241bc276cd
    37   fix z::'a and X::"'a set"
    37   fix z::'a and X::"'a set"
    38   assume "X \<noteq> {}"
    38   assume "X \<noteq> {}"
    39   hence "\<And>i. (\<lambda>x. x \<bullet> i) ` X \<noteq> {}" by simp
    39   hence "\<And>i. (\<lambda>x. x \<bullet> i) ` X \<noteq> {}" by simp
    40   thus "(\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> z \<le> Inf X" "(\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X \<le> z"
    40   thus "(\<And>x. x \<in> X \<Longrightarrow> z \<le> x) \<Longrightarrow> z \<le> Inf X" "(\<And>x. x \<in> X \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup X \<le> z"
    41     by (auto simp: eucl_Inf eucl_Sup eucl_le Inf_class.INF_def Sup_class.SUP_def
    41     by (auto simp: eucl_Inf eucl_Sup eucl_le Inf_class.INF_def Sup_class.SUP_def
       
    42       simp del: Inf_class.Inf_image_eq Sup_class.Sup_image_eq
    42       intro!: cInf_greatest cSup_least)
    43       intro!: cInf_greatest cSup_least)
    43 qed (force intro!: cInf_lower cSup_upper
    44 qed (force intro!: cInf_lower cSup_upper
    44       simp: bdd_below_def bdd_above_def preorder_class.bdd_below_def preorder_class.bdd_above_def
    45       simp: bdd_below_def bdd_above_def preorder_class.bdd_below_def preorder_class.bdd_above_def
    45         eucl_Inf eucl_Sup eucl_le Inf_class.INF_def Sup_class.SUP_def)+
    46         eucl_Inf eucl_Sup eucl_le Inf_class.INF_def Sup_class.SUP_def
       
    47       simp del: Inf_class.Inf_image_eq Sup_class.Sup_image_eq)+
    46 
    48 
    47 lemma inner_Basis_inf_left: "i \<in> Basis \<Longrightarrow> inf x y \<bullet> i = inf (x \<bullet> i) (y \<bullet> i)"
    49 lemma inner_Basis_inf_left: "i \<in> Basis \<Longrightarrow> inf x y \<bullet> i = inf (x \<bullet> i) (y \<bullet> i)"
    48   and inner_Basis_sup_left: "i \<in> Basis \<Longrightarrow> sup x y \<bullet> i = sup (x \<bullet> i) (y \<bullet> i)"
    50   and inner_Basis_sup_left: "i \<in> Basis \<Longrightarrow> sup x y \<bullet> i = sup (x \<bullet> i) (y \<bullet> i)"
    49   by (simp_all add: eucl_inf eucl_sup inner_setsum_left inner_Basis if_distrib setsum_delta
    51   by (simp_all add: eucl_inf eucl_sup inner_setsum_left inner_Basis if_distrib setsum_delta
    50       cong: if_cong)
    52       cong: if_cong)
    51 
    53 
    52 lemma inner_Basis_INF_left: "i \<in> Basis \<Longrightarrow> (INF x:X. f x) \<bullet> i = (INF x:X. f x \<bullet> i)"
    54 lemma inner_Basis_INF_left: "i \<in> Basis \<Longrightarrow> (INF x:X. f x) \<bullet> i = (INF x:X. f x \<bullet> i)"
    53   and inner_Basis_SUP_left: "i \<in> Basis \<Longrightarrow> (SUP x:X. f x) \<bullet> i = (SUP x:X. f x \<bullet> i)"
    55   and inner_Basis_SUP_left: "i \<in> Basis \<Longrightarrow> (SUP x:X. f x) \<bullet> i = (SUP x:X. f x \<bullet> i)"
    54   by (simp_all add: INF_def SUP_def eucl_Sup eucl_Inf)
    56   using eucl_Sup [of "f ` X"] eucl_Inf [of "f ` X"] by (simp_all add: comp_def)
    55 
    57 
    56 lemma abs_inner: "i \<in> Basis \<Longrightarrow> abs x \<bullet> i = abs (x \<bullet> i)"
    58 lemma abs_inner: "i \<in> Basis \<Longrightarrow> abs x \<bullet> i = abs (x \<bullet> i)"
    57   by (auto simp: eucl_abs)
    59   by (auto simp: eucl_abs)
    58 
    60 
    59 lemma
    61 lemma
    85   assumes sup: "\<And>b x. b \<in> Basis \<Longrightarrow> x \<in> s \<Longrightarrow> x \<bullet> b \<le> X \<bullet> b"
    87   assumes sup: "\<And>b x. b \<in> Basis \<Longrightarrow> x \<in> s \<Longrightarrow> x \<bullet> b \<le> X \<bullet> b"
    86   assumes i_s: "\<And>b. b \<in> Basis \<Longrightarrow> (i b \<bullet> b) \<in> (\<lambda>x. x \<bullet> b) ` s"
    88   assumes i_s: "\<And>b. b \<in> Basis \<Longrightarrow> (i b \<bullet> b) \<in> (\<lambda>x. x \<bullet> b) ` s"
    87   shows "Sup s = X"
    89   shows "Sup s = X"
    88   using assms
    90   using assms
    89   unfolding eucl_Sup euclidean_representation_setsum
    91   unfolding eucl_Sup euclidean_representation_setsum
    90   by (auto simp: Sup_class.SUP_def intro!: conditionally_complete_lattice_class.cSup_eq_maximum)
    92   by (auto simp: Sup_class.SUP_def simp del: Sup_class.Sup_image_eq intro!: conditionally_complete_lattice_class.cSup_eq_maximum)
    91 
    93 
    92 lemma Inf_eq_minimum_componentwise:
    94 lemma Inf_eq_minimum_componentwise:
    93   assumes i: "\<And>b. b \<in> Basis \<Longrightarrow> X \<bullet> b = i b \<bullet> b"
    95   assumes i: "\<And>b. b \<in> Basis \<Longrightarrow> X \<bullet> b = i b \<bullet> b"
    94   assumes sup: "\<And>b x. b \<in> Basis \<Longrightarrow> x \<in> s \<Longrightarrow> X \<bullet> b \<le> x \<bullet> b"
    96   assumes sup: "\<And>b x. b \<in> Basis \<Longrightarrow> x \<in> s \<Longrightarrow> X \<bullet> b \<le> x \<bullet> b"
    95   assumes i_s: "\<And>b. b \<in> Basis \<Longrightarrow> (i b \<bullet> b) \<in> (\<lambda>x. x \<bullet> b) ` s"
    97   assumes i_s: "\<And>b. b \<in> Basis \<Longrightarrow> (i b \<bullet> b) \<in> (\<lambda>x. x \<bullet> b) ` s"
    96   shows "Inf s = X"
    98   shows "Inf s = X"
    97   using assms
    99   using assms
    98   unfolding eucl_Inf euclidean_representation_setsum
   100   unfolding eucl_Inf euclidean_representation_setsum
    99   by (auto simp: Inf_class.INF_def intro!: conditionally_complete_lattice_class.cInf_eq_minimum)
   101   by (auto simp: Inf_class.INF_def simp del: Inf_class.Inf_image_eq intro!: conditionally_complete_lattice_class.cInf_eq_minimum)
   100 
   102 
   101 end
   103 end
   102 
   104 
   103 lemma
   105 lemma
   104   compact_attains_Inf_componentwise:
   106   compact_attains_Inf_componentwise:
   113   obtain s x
   115   obtain s x
   114     where s: "s\<in>(\<lambda>x. x \<bullet> b) ` X" "\<And>t. t\<in>(\<lambda>x. x \<bullet> b) ` X \<Longrightarrow> s \<le> t"
   116     where s: "s\<in>(\<lambda>x. x \<bullet> b) ` X" "\<And>t. t\<in>(\<lambda>x. x \<bullet> b) ` X \<Longrightarrow> s \<le> t"
   115       and x: "x \<in> X" "s = x \<bullet> b" "\<And>y. y \<in> X \<Longrightarrow> x \<bullet> b \<le> y \<bullet> b"
   117       and x: "x \<in> X" "s = x \<bullet> b" "\<And>y. y \<in> X \<Longrightarrow> x \<bullet> b \<le> y \<bullet> b"
   116     by auto
   118     by auto
   117   hence "Inf ?proj = x \<bullet> b"
   119   hence "Inf ?proj = x \<bullet> b"
   118     by (auto intro!: conditionally_complete_lattice_class.cInf_eq_minimum)
   120     by (auto intro!: conditionally_complete_lattice_class.cInf_eq_minimum simp del: Inf_class.Inf_image_eq)
   119   hence "x \<bullet> b = Inf X \<bullet> b"
   121   hence "x \<bullet> b = Inf X \<bullet> b"
   120     by (auto simp: eucl_Inf Inf_class.INF_def inner_setsum_left inner_Basis if_distrib `b \<in> Basis`
   122     by (auto simp: eucl_Inf Inf_class.INF_def inner_setsum_left inner_Basis if_distrib `b \<in> Basis` setsum_delta
   121       setsum_delta cong: if_cong)
   123       simp del: Inf_class.Inf_image_eq
       
   124       cong: if_cong)
   122   with x show "\<exists>x. x \<in> X \<and> x \<bullet> b = Inf X \<bullet> b \<and> (\<forall>y. y \<in> X \<longrightarrow> x \<bullet> b \<le> y \<bullet> b)" by blast
   125   with x show "\<exists>x. x \<in> X \<and> x \<bullet> b = Inf X \<bullet> b \<and> (\<forall>y. y \<in> X \<longrightarrow> x \<bullet> b \<le> y \<bullet> b)" by blast
   123 qed
   126 qed
   124 
   127 
   125 lemma
   128 lemma
   126   compact_attains_Sup_componentwise:
   129   compact_attains_Sup_componentwise:
   135   obtain s x
   138   obtain s x
   136     where s: "s\<in>(\<lambda>x. x \<bullet> b) ` X" "\<And>t. t\<in>(\<lambda>x. x \<bullet> b) ` X \<Longrightarrow> t \<le> s"
   139     where s: "s\<in>(\<lambda>x. x \<bullet> b) ` X" "\<And>t. t\<in>(\<lambda>x. x \<bullet> b) ` X \<Longrightarrow> t \<le> s"
   137       and x: "x \<in> X" "s = x \<bullet> b" "\<And>y. y \<in> X \<Longrightarrow> y \<bullet> b \<le> x \<bullet> b"
   140       and x: "x \<in> X" "s = x \<bullet> b" "\<And>y. y \<in> X \<Longrightarrow> y \<bullet> b \<le> x \<bullet> b"
   138     by auto
   141     by auto
   139   hence "Sup ?proj = x \<bullet> b"
   142   hence "Sup ?proj = x \<bullet> b"
   140     by (auto intro!: cSup_eq_maximum)
   143     by (auto intro!: cSup_eq_maximum simp del: Sup_image_eq)
   141   hence "x \<bullet> b = Sup X \<bullet> b"
   144   hence "x \<bullet> b = Sup X \<bullet> b"
   142     by (auto simp: eucl_Sup[where 'a='a] SUP_def inner_setsum_left inner_Basis if_distrib `b \<in> Basis`
   145     by (auto simp: eucl_Sup[where 'a='a] SUP_def inner_setsum_left inner_Basis if_distrib `b \<in> Basis` setsum_delta
   143       setsum_delta cong: if_cong)
   146       simp del: Sup_image_eq cong: if_cong)
   144   with x show "\<exists>x. x \<in> X \<and> x \<bullet> b = Sup X \<bullet> b \<and> (\<forall>y. y \<in> X \<longrightarrow> y \<bullet> b \<le> x \<bullet> b)" by blast
   147   with x show "\<exists>x. x \<in> X \<and> x \<bullet> b = Sup X \<bullet> b \<and> (\<forall>y. y \<in> X \<longrightarrow> y \<bullet> b \<le> x \<bullet> b)" by blast
   145 qed
   148 qed
   146 
   149 
   147 lemma (in order) atLeastatMost_empty'[simp]:
   150 lemma (in order) atLeastatMost_empty'[simp]:
   148   "(~ a <= b) \<Longrightarrow> {a..b} = {}"
   151   "(~ a <= b) \<Longrightarrow> {a..b} = {}"
   713   unfolding open_inter_closure_eq_empty[OF open_interval] ..
   716   unfolding open_inter_closure_eq_empty[OF open_interval] ..
   714 
   717 
   715 lemma diameter_closed_interval:
   718 lemma diameter_closed_interval:
   716   fixes a b::"'a::ordered_euclidean_space"
   719   fixes a b::"'a::ordered_euclidean_space"
   717   shows "a \<le> b \<Longrightarrow> diameter {a..b} = dist a b"
   720   shows "a \<le> b \<Longrightarrow> diameter {a..b} = dist a b"
   718   by (force simp add: diameter_def SUP_def intro!: cSup_eq_maximum setL2_mono
   721   by (force simp add: diameter_def SUP_def simp del: Sup_image_eq intro!: cSup_eq_maximum setL2_mono
   719      simp: euclidean_dist_l2[where 'a='a] eucl_le[where 'a='a] dist_norm)
   722      simp: euclidean_dist_l2[where 'a='a] eucl_le[where 'a='a] dist_norm)
   720 
   723 
   721 text {* Intervals in general, including infinite and mixtures of open and closed. *}
   724 text {* Intervals in general, including infinite and mixtures of open and closed. *}
   722 
   725 
   723 definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow>
   726 definition "is_interval (s::('a::euclidean_space) set) \<longleftrightarrow>