diff -r 1e9e68247ad1 -r ebf9d4fd00ba src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Fri Mar 22 10:41:43 2013 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Fri Mar 22 10:41:43 2013 +0100 @@ -1401,7 +1401,7 @@ show "(\n. f (S n)) ----> Inf (f ` ({x<..} \ I))" proof (rule LIMSEQ_I, rule ccontr) fix r :: real assume "0 < r" - with Inf_close[of "f ` ({x<..} \ I)" r] + with cInf_close[of "f ` ({x<..} \ I)" r] obtain y where y: "x < y" "y \ I" "f y < Inf (f ` ({x <..} \ I)) + r" by auto from `x < y` have "0 < y - x" by auto from S(2)[THEN LIMSEQ_D, OF this] @@ -1409,7 +1409,7 @@ assume "\ (\N. \n\N. norm (f (S n) - Inf (f ` ({x<..} \ I))) < r)" moreover have "\n. Inf (f ` ({x<..} \ I)) \ f (S n)" - using S bnd by (intro Inf_lower[where z=K]) auto + using S bnd by (intro cInf_lower[where z=K]) auto ultimately obtain n where n: "N \ n" "r + Inf (f ` ({x<..} \ I)) \ f (S n)" by (auto simp: not_less field_simps) with N[OF n(1)] mono[OF _ `y \ I`, of "S n"] S(1)[THEN spec, of n] y @@ -1727,11 +1727,11 @@ unfolding closure_approachable proof safe have *: "\x\S. Inf S \ x" - using Inf_lower_EX[of _ S] assms by metis + using cInf_lower_EX[of _ S] assms by metis fix e :: real assume "0 < e" then obtain x where x: "x \ S" "x < Inf S + e" - using Inf_close `S \ {}` by auto + using cInf_close `S \ {}` by auto moreover then have "x > Inf S - e" using * by auto ultimately have "abs (x - Inf S) < e" by (simp add: abs_diff_less_iff) then show "\x\S. dist x (Inf S) < e" @@ -1785,13 +1785,13 @@ lemma infdist_nonneg: shows "0 \ infdist x A" - using assms by (auto simp add: infdist_def) + using assms by (auto simp add: infdist_def intro: cInf_greatest) lemma infdist_le: assumes "a \ A" assumes "d = dist x a" shows "infdist x A \ d" - using assms by (auto intro!: SupInf.Inf_lower[where z=0] simp add: infdist_def) + using assms by (auto intro!: cInf_lower[where z=0] simp add: infdist_def) lemma infdist_zero[simp]: assumes "a \ A" shows "infdist a A = 0" @@ -1807,13 +1807,13 @@ next assume "A \ {}" then obtain a where "a \ A" by auto have "infdist x A \ Inf {dist x y + dist y a |a. a \ A}" - proof + proof (rule cInf_greatest) from `A \ {}` show "{dist x y + dist y a |a. a \ A} \ {}" by simp fix d assume "d \ {dist x y + dist y a |a. a \ A}" then obtain a where d: "d = dist x y + dist y a" "a \ A" by auto show "infdist x A \ d" unfolding infdist_notempty[OF `A \ {}`] - proof (rule Inf_lower2) + proof (rule cInf_lower2) show "dist x a \ {dist x a |a. a \ A}" using `a \ A` by auto show "dist x a \ d" unfolding d by (rule dist_triangle) fix d assume "d \ {dist x a |a. a \ A}" @@ -1822,20 +1822,19 @@ qed qed also have "\ = dist x y + infdist y A" - proof (rule Inf_eq, safe) + proof (rule cInf_eq, safe) fix a assume "a \ A" thus "dist x y + infdist y A \ dist x y + dist y a" by (auto intro: infdist_le) next fix i assume inf: "\d. d \ {dist x y + dist y a |a. a \ A} \ i \ d" hence "i - dist x y \ infdist y A" unfolding infdist_notempty[OF `A \ {}`] using `a \ A` - by (intro Inf_greatest) (auto simp: field_simps) + by (intro cInf_greatest) (auto simp: field_simps) thus "i \ dist x y + infdist y A" by simp qed finally show ?thesis by simp qed -lemma - in_closure_iff_infdist_zero: +lemma in_closure_iff_infdist_zero: assumes "A \ {}" shows "x \ closure A \ infdist x A = 0" proof @@ -1859,13 +1858,12 @@ assume "\ (\y\A. dist y x < e)" hence "infdist x A \ e" using `a \ A` unfolding infdist_def - by (force simp: dist_commute) + by (force simp: dist_commute intro: cInf_greatest) with x `0 < e` show False by auto qed qed -lemma - in_closed_iff_infdist_zero: +lemma in_closed_iff_infdist_zero: assumes "closed A" "A \ {}" shows "x \ A \ infdist x A = 0" proof - @@ -2326,16 +2324,19 @@ proof fix x assume "x\S" thus "x \ Sup S" - by (metis SupInf.Sup_upper abs_le_D1 assms(1) bounded_real) + by (metis cSup_upper abs_le_D1 assms(1) bounded_real) next show "\b. (\x\S. x \ b) \ Sup S \ b" using assms - by (metis SupInf.Sup_least) + by (metis cSup_least) qed lemma Sup_insert: fixes S :: "real set" shows "bounded S ==> Sup(insert x S) = (if S = {} then x else max x (Sup S))" -by auto (metis Int_absorb Sup_insert_nonempty assms bounded_has_Sup(1) disjoint_iff_not_equal) + apply (subst cSup_insert_If) + apply (rule bounded_has_Sup(1)[of S, rule_format]) + apply (auto simp: sup_max) + done lemma Sup_insert_finite: fixes S :: "real set" @@ -2352,16 +2353,19 @@ fix x assume "x\S" from assms(1) obtain a where a:"\x\S. \x\ \ a" unfolding bounded_real by auto thus "x \ Inf S" using `x\S` - by (metis Inf_lower_EX abs_le_D2 minus_le_iff) + by (metis cInf_lower_EX abs_le_D2 minus_le_iff) next show "\b. (\x\S. x >= b) \ Inf S \ b" using assms - by (metis SupInf.Inf_greatest) + by (metis cInf_greatest) qed lemma Inf_insert: fixes S :: "real set" shows "bounded S ==> Inf(insert x S) = (if S = {} then x else min x (Inf S))" -by auto (metis Int_absorb Inf_insert_nonempty bounded_has_Inf(1) disjoint_iff_not_equal) + apply (subst cInf_insert_if) + apply (rule bounded_has_Inf(1)[of S, rule_format]) + apply (auto simp: inf_min) + done lemma Inf_insert_finite: fixes S :: "real set" @@ -3125,7 +3129,7 @@ lemma cauchy_def: "Cauchy s \ (\e>0. \N. \m n. m \ N \ n \ N --> dist(s m)(s n) < e)" -unfolding Cauchy_def by blast +unfolding Cauchy_def by metis fun helper_1::"('a::metric_space set) \ real \ nat \ 'a" where "helper_1 s e n = (SOME y::'a. y \ s \ (\m (dist (helper_1 s e m) y < e)))" @@ -5197,7 +5201,7 @@ from s obtain z d where z: "\x. x \ s \ dist z x \ d" unfolding bounded_def by auto have "dist x y \ Sup ?D" - proof (rule Sup_upper, safe) + proof (rule cSup_upper, safe) fix a b assume "a \ s" "b \ s" with z[of a] z[of b] dist_triangle[of a b z] show "dist a b \ 2 * d" @@ -5219,7 +5223,7 @@ by (auto simp: diameter_def) then have "?D \ {}" by auto ultimately have "Sup ?D \ d" - by (intro Sup_least) (auto simp: not_less) + by (intro cSup_least) (auto simp: not_less) with `d < diameter s` `s \ {}` show False by (auto simp: diameter_def) qed @@ -5239,7 +5243,7 @@ then obtain x y where xys:"x\s" "y\s" and xy:"\u\s. \v\s. dist u v \ dist x y" using compact_sup_maxdistance[OF assms] by auto hence "diameter s \ dist x y" - unfolding diameter_def by clarsimp (rule Sup_least, fast+) + unfolding diameter_def by clarsimp (rule cSup_least, fast+) thus ?thesis by (metis b diameter_bounded_bound order_antisym xys) qed @@ -6675,5 +6679,4 @@ declare tendsto_const [intro] (* FIXME: move *) - end