src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
changeset 44457 d366fa5551ef
parent 44365 5daa55003649
child 44516 d9a496ae5d9d
equal deleted inserted replaced
44456:aae9c9a0735e 44457:d366fa5551ef
    12 
    12 
    13 (* to be moved elsewhere *)
    13 (* to be moved elsewhere *)
    14 
    14 
    15 lemma euclidean_dist_l2:"dist x (y::'a::euclidean_space) = setL2 (\<lambda>i. dist(x$$i) (y$$i)) {..<DIM('a)}"
    15 lemma euclidean_dist_l2:"dist x (y::'a::euclidean_space) = setL2 (\<lambda>i. dist(x$$i) (y$$i)) {..<DIM('a)}"
    16   unfolding dist_norm norm_eq_sqrt_inner setL2_def apply(subst euclidean_inner)
    16   unfolding dist_norm norm_eq_sqrt_inner setL2_def apply(subst euclidean_inner)
    17   apply(auto simp add:power2_eq_square) unfolding euclidean_component_diff ..
    17   by(auto simp add:power2_eq_square)
    18 
    18 
    19 lemma dist_nth_le: "dist (x $$ i) (y $$ i) \<le> dist x (y::'a::euclidean_space)"
    19 lemma dist_nth_le: "dist (x $$ i) (y $$ i) \<le> dist x (y::'a::euclidean_space)"
    20   apply(subst(2) euclidean_dist_l2) apply(cases "i<DIM('a)")
    20   apply(subst(2) euclidean_dist_l2) apply(cases "i<DIM('a)")
    21   apply(rule member_le_setL2) by auto
    21   apply(rule member_le_setL2) by auto
    22 
    22 
  5599 
  5599 
  5600 subsection {* Some properties of a canonical subspace *}
  5600 subsection {* Some properties of a canonical subspace *}
  5601 
  5601 
  5602 lemma subspace_substandard:
  5602 lemma subspace_substandard:
  5603   "subspace {x::'a::euclidean_space. (\<forall>i<DIM('a). P i \<longrightarrow> x$$i = 0)}"
  5603   "subspace {x::'a::euclidean_space. (\<forall>i<DIM('a). P i \<longrightarrow> x$$i = 0)}"
  5604   unfolding subspace_def by(auto simp add: euclidean_simps) (* FIXME: duplicate rewrite rule *)
  5604   unfolding subspace_def by auto
  5605 
  5605 
  5606 lemma closed_substandard:
  5606 lemma closed_substandard:
  5607  "closed {x::'a::euclidean_space. \<forall>i<DIM('a). P i --> x$$i = 0}" (is "closed ?A")
  5607  "closed {x::'a::euclidean_space. \<forall>i<DIM('a). P i --> x$$i = 0}" (is "closed ?A")
  5608 proof-
  5608 proof-
  5609   let ?D = "{i. P i} \<inter> {..<DIM('a)}"
  5609   let ?D = "{i. P i} \<inter> {..<DIM('a)}"
  5610   let ?Bs = "{{x::'a. inner (basis i) x = 0}| i. i \<in> ?D}"
  5610   have "closed (\<Inter>i\<in>?D. {x::'a. x$$i = 0})"
  5611   { fix x
  5611     by (simp add: closed_INT closed_Collect_eq)
  5612     { assume "x\<in>?A"
  5612   also have "(\<Inter>i\<in>?D. {x::'a. x$$i = 0}) = ?A"
  5613       hence x:"\<forall>i\<in>?D. x $$ i = 0" by auto
  5613     by auto
  5614       hence "x\<in> \<Inter> ?Bs" by(auto simp add: x euclidean_component_def) }
  5614   finally show "closed ?A" .
  5615     moreover
       
  5616     { assume x:"x\<in>\<Inter>?Bs"
       
  5617       { fix i assume i:"i \<in> ?D"
       
  5618         then obtain B where BB:"B \<in> ?Bs" and B:"B = {x::'a. inner (basis i) x = 0}" by auto
       
  5619         hence "x $$ i = 0" unfolding B using x unfolding euclidean_component_def by auto  }
       
  5620       hence "x\<in>?A" by auto }
       
  5621     ultimately have "x\<in>?A \<longleftrightarrow> x\<in> \<Inter>?Bs" .. }
       
  5622   hence "?A = \<Inter> ?Bs" by auto
       
  5623   thus ?thesis by(auto simp add: closed_Inter closed_hyperplane)
       
  5624 qed
  5615 qed
  5625 
  5616 
  5626 lemma dim_substandard: assumes "d\<subseteq>{..<DIM('a::euclidean_space)}"
  5617 lemma dim_substandard: assumes "d\<subseteq>{..<DIM('a::euclidean_space)}"
  5627   shows "dim {x::'a::euclidean_space. \<forall>i<DIM('a). i \<notin> d \<longrightarrow> x$$i = 0} = card d" (is "dim ?A = _")
  5618   shows "dim {x::'a::euclidean_space. \<forall>i<DIM('a). i \<notin> d \<longrightarrow> x$$i = 0} = card d" (is "dim ?A = _")
  5628 proof-
  5619 proof-
  5643       have **:"F \<subseteq> insert k F" by auto
  5634       have **:"F \<subseteq> insert k F" by auto
  5644       def y \<equiv> "x - x$$k *\<^sub>R basis k"
  5635       def y \<equiv> "x - x$$k *\<^sub>R basis k"
  5645       have y:"x = y + (x$$k) *\<^sub>R basis k" unfolding y_def by auto
  5636       have y:"x = y + (x$$k) *\<^sub>R basis k" unfolding y_def by auto
  5646       { fix i assume i':"i \<notin> F"
  5637       { fix i assume i':"i \<notin> F"
  5647         hence "y $$ i = 0" unfolding y_def 
  5638         hence "y $$ i = 0" unfolding y_def 
  5648           using *[THEN spec[where x=i]] by(auto simp add: euclidean_simps) }
  5639           using *[THEN spec[where x=i]] by auto }
  5649       hence "y \<in> span (basis ` F)" using insert(3) by auto
  5640       hence "y \<in> span (basis ` F)" using insert(3) by auto
  5650       hence "y \<in> span (basis ` (insert k F))"
  5641       hence "y \<in> span (basis ` (insert k F))"
  5651         using span_mono[of "?bas ` F" "?bas ` (insert k F)"]
  5642         using span_mono[of "?bas ` F" "?bas ` (insert k F)"]
  5652         using image_mono[OF **, of basis] using assms by auto
  5643         using image_mono[OF **, of basis] using assms by auto
  5653       moreover
  5644       moreover
  5761   ultimately show ?thesis by auto
  5752   ultimately show ?thesis by auto
  5762 next
  5753 next
  5763   case False
  5754   case False
  5764   { fix y assume "a \<le> y" "y \<le> b" "m > 0"
  5755   { fix y assume "a \<le> y" "y \<le> b" "m > 0"
  5765     hence "m *\<^sub>R a + c \<le> m *\<^sub>R y + c"  "m *\<^sub>R y + c \<le> m *\<^sub>R b + c"
  5756     hence "m *\<^sub>R a + c \<le> m *\<^sub>R y + c"  "m *\<^sub>R y + c \<le> m *\<^sub>R b + c"
  5766       unfolding eucl_le[where 'a='a] by(auto simp add: euclidean_simps)
  5757       unfolding eucl_le[where 'a='a] by auto
  5767   } moreover
  5758   } moreover
  5768   { fix y assume "a \<le> y" "y \<le> b" "m < 0"
  5759   { fix y assume "a \<le> y" "y \<le> b" "m < 0"
  5769     hence "m *\<^sub>R b + c \<le> m *\<^sub>R y + c"  "m *\<^sub>R y + c \<le> m *\<^sub>R a + c"
  5760     hence "m *\<^sub>R b + c \<le> m *\<^sub>R y + c"  "m *\<^sub>R y + c \<le> m *\<^sub>R a + c"
  5770       unfolding eucl_le[where 'a='a] by(auto simp add: mult_left_mono_neg euclidean_simps)
  5761       unfolding eucl_le[where 'a='a] by(auto simp add: mult_left_mono_neg)
  5771   } moreover
  5762   } moreover
  5772   { fix y assume "m > 0"  "m *\<^sub>R a + c \<le> y"  "y \<le> m *\<^sub>R b + c"
  5763   { fix y assume "m > 0"  "m *\<^sub>R a + c \<le> y"  "y \<le> m *\<^sub>R b + c"
  5773     hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}"
  5764     hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}"
  5774       unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a]
  5765       unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a]
  5775       apply(auto simp add: pth_3[symmetric] 
  5766       apply(auto simp add: pth_3[symmetric] 
  5776         intro!: exI[where x="(1 / m) *\<^sub>R (y - c)"]) 
  5767         intro!: exI[where x="(1 / m) *\<^sub>R (y - c)"]) 
  5777       by(auto simp add: pos_le_divide_eq pos_divide_le_eq mult_commute diff_le_iff euclidean_simps)
  5768       by(auto simp add: pos_le_divide_eq pos_divide_le_eq mult_commute diff_le_iff)
  5778   } moreover
  5769   } moreover
  5779   { fix y assume "m *\<^sub>R b + c \<le> y" "y \<le> m *\<^sub>R a + c" "m < 0"
  5770   { fix y assume "m *\<^sub>R b + c \<le> y" "y \<le> m *\<^sub>R a + c" "m < 0"
  5780     hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}"
  5771     hence "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` {a..b}"
  5781       unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a]
  5772       unfolding image_iff Bex_def mem_interval eucl_le[where 'a='a]
  5782       apply(auto simp add: pth_3[symmetric]
  5773       apply(auto simp add: pth_3[symmetric]
  5783         intro!: exI[where x="(1 / m) *\<^sub>R (y - c)"])
  5774         intro!: exI[where x="(1 / m) *\<^sub>R (y - c)"])
  5784       by(auto simp add: neg_le_divide_eq neg_divide_le_eq mult_commute diff_le_iff euclidean_simps)
  5775       by(auto simp add: neg_le_divide_eq neg_divide_le_eq mult_commute diff_le_iff)
  5785   }
  5776   }
  5786   ultimately show ?thesis using False by auto
  5777   ultimately show ?thesis using False by auto
  5787 qed
  5778 qed
  5788 
  5779 
  5789 lemma image_smult_interval:"(\<lambda>x. m *\<^sub>R (x::_::ordered_euclidean_space)) ` {a..b} =
  5780 lemma image_smult_interval:"(\<lambda>x. m *\<^sub>R (x::_::ordered_euclidean_space)) ` {a..b} =