src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy
 changeset 54260 6a967667fd45 parent 54259 71c701dc5bf9 child 54263 c4159fe6fa46
```     1.1 --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Tue Nov 05 09:44:59 2013 +0100
1.2 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy	Tue Nov 05 09:44:59 2013 +0100
1.3 @@ -1972,22 +1972,25 @@
1.4
1.5  subsection {* Infimum Distance *}
1.6
1.7 -definition "infdist x A = (if A = {} then 0 else Inf {dist x a|a. a \<in> A})"
1.8 -
1.9 -lemma bdd_below_infdist[intro, simp]: "bdd_below {dist x a|a. a \<in> A}"
1.10 +definition "infdist x A = (if A = {} then 0 else INF a:A. dist x a)"
1.11 +
1.12 +lemma bdd_below_infdist[intro, simp]: "bdd_below (dist x`A)"
1.13    by (auto intro!: zero_le_dist)
1.14
1.15 -lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = Inf {dist x a|a. a \<in> A}"
1.16 +lemma infdist_notempty: "A \<noteq> {} \<Longrightarrow> infdist x A = (INF a:A. dist x a)"
1.18
1.19  lemma infdist_nonneg: "0 \<le> infdist x A"
1.20 -  by (auto simp add: infdist_def intro: cInf_greatest)
1.21 -
1.22 -lemma infdist_le: "a \<in> A \<Longrightarrow> d = dist x a \<Longrightarrow> infdist x A \<le> d"
1.23 -  using assms by (auto intro: cInf_lower simp add: infdist_def)
1.24 +  by (auto simp add: infdist_def intro: cINF_greatest)
1.25 +
1.26 +lemma infdist_le: "a \<in> A \<Longrightarrow> infdist x A \<le> dist x a"
1.27 +  by (auto intro: cINF_lower simp add: infdist_def)
1.28 +
1.29 +lemma infdist_le2: "a \<in> A \<Longrightarrow> dist x a \<le> d \<Longrightarrow> infdist x A \<le> d"
1.30 +  by (auto intro!: cINF_lower2 simp add: infdist_def)
1.31
1.32  lemma infdist_zero[simp]: "a \<in> A \<Longrightarrow> infdist a A = 0"
1.33 -  by (auto intro!: antisym infdist_nonneg infdist_le)
1.34 +  by (auto intro!: antisym infdist_nonneg infdist_le2)
1.35
1.36  lemma infdist_triangle: "infdist x A \<le> infdist y A + dist x y"
1.37  proof (cases "A = {}")
1.38 @@ -2006,9 +2009,8 @@
1.39        by auto
1.40      show "infdist x A \<le> d"
1.41        unfolding infdist_notempty[OF `A \<noteq> {}`]
1.42 -    proof (rule cInf_lower2)
1.43 -      show "dist x a \<in> {dist x a |a. a \<in> A}"
1.44 -        using `a \<in> A` by auto
1.45 +    proof (rule cINF_lower2)
1.46 +      show "a \<in> A" by fact
1.47        show "dist x a \<le> d"
1.48          unfolding d by (rule dist_triangle)
1.49      qed simp
1.50 @@ -2024,7 +2026,7 @@
1.51      assume inf: "\<And>d. d \<in> {dist x y + dist y a |a. a \<in> A} \<Longrightarrow> i \<le> d"
1.52      then have "i - dist x y \<le> infdist y A"
1.53        unfolding infdist_notempty[OF `A \<noteq> {}`] using `a \<in> A`
1.54 -      by (intro cInf_greatest) (auto simp: field_simps)
1.55 +      by (intro cINF_greatest) (auto simp: field_simps)
1.56      then show "i \<le> dist x y + infdist y A"
1.57        by simp
1.58    qed
1.59 @@ -2063,7 +2065,7 @@
1.60      assume "\<not> (\<exists>y\<in>A. dist y x < e)"
1.61      then have "infdist x A \<ge> e" using `a \<in> A`
1.62        unfolding infdist_def
1.63 -      by (force simp: dist_commute intro: cInf_greatest)
1.64 +      by (force simp: dist_commute intro: cINF_greatest)
1.65      with x `e > 0` show False by auto
1.66    qed
1.67  qed
1.68 @@ -5701,28 +5703,27 @@
1.69
1.70  text {* We can state this in terms of diameter of a set. *}
1.71
1.72 -definition "diameter s = (if s = {} then 0::real else Sup {dist x y | x y. x \<in> s \<and> y \<in> s})"
1.73 +definition diameter :: "'a::metric_space set \<Rightarrow> real" where
1.74 +  "diameter S = (if S = {} then 0 else SUP (x,y):S\<times>S. dist x y)"
1.75
1.76  lemma diameter_bounded_bound:
1.77    fixes s :: "'a :: metric_space set"
1.78    assumes s: "bounded s" "x \<in> s" "y \<in> s"
1.79    shows "dist x y \<le> diameter s"
1.80  proof -
1.81 -  let ?D = "{dist x y |x y. x \<in> s \<and> y \<in> s}"
1.82    from s obtain z d where z: "\<And>x. x \<in> s \<Longrightarrow> dist z x \<le> d"
1.83      unfolding bounded_def by auto
1.84 -  have "dist x y \<le> Sup ?D"
1.85 -  proof (rule cSup_upper)
1.86 -    show "bdd_above ?D"
1.87 -      unfolding bdd_above_def
1.88 -    proof (safe intro!: exI)
1.89 -      fix a b
1.90 -      assume "a \<in> s" "b \<in> s"
1.91 -      with z[of a] z[of b] dist_triangle[of a b z]
1.92 -      show "dist a b \<le> 2 * d"
1.93 -        by (simp add: dist_commute)
1.94 -    qed
1.95 -  qed (insert s, auto)
1.96 +  have "bdd_above (split dist ` (s\<times>s))"
1.97 +  proof (intro bdd_aboveI, safe)
1.98 +    fix a b
1.99 +    assume "a \<in> s" "b \<in> s"
1.100 +    with z[of a] z[of b] dist_triangle[of a b z]
1.101 +    show "dist a b \<le> 2 * d"
1.102 +      by (simp add: dist_commute)
1.103 +  qed
1.104 +  moreover have "(x,y) \<in> s\<times>s" using s by auto
1.105 +  ultimately have "dist x y \<le> (SUP (x,y):s\<times>s. dist x y)"
1.106 +    by (rule cSUP_upper2) simp
1.107    with `x \<in> s` show ?thesis
1.108      by (auto simp add: diameter_def)
1.109  qed
1.110 @@ -5733,16 +5734,12 @@
1.111      and d: "0 < d" "d < diameter s"
1.112    shows "\<exists>x\<in>s. \<exists>y\<in>s. d < dist x y"
1.113  proof (rule ccontr)
1.114 -  let ?D = "{dist x y |x y. x \<in> s \<and> y \<in> s}"
1.115    assume contr: "\<not> ?thesis"
1.116 -  moreover
1.117 -  from d have "s \<noteq> {}"
1.118 -    by (auto simp: diameter_def)
1.119 -  then have "?D \<noteq> {}" by auto
1.120 -  ultimately have "Sup ?D \<le> d"
1.121 -    by (intro cSup_least) (auto simp: not_less)
1.122 -  with `d < diameter s` `s \<noteq> {}` show False
1.123 -    by (auto simp: diameter_def)
1.124 +  moreover have "s \<noteq> {}"
1.125 +    using d by (auto simp add: diameter_def)
1.126 +  ultimately have "diameter s \<le> d"
1.127 +    by (auto simp: not_less diameter_def intro!: cSUP_least)
1.128 +  with `d < diameter s` show False by auto
1.129  qed
1.130
1.131  lemma diameter_bounded:
1.132 @@ -5765,7 +5762,7 @@
1.133    then have "diameter s \<le> dist x y"
1.134      unfolding diameter_def
1.135      apply clarsimp
1.136 -    apply (rule cSup_least)
1.137 +    apply (rule cSUP_least)
1.138      apply fast+
1.139      done
1.140    then show ?thesis
```