# HG changeset patch # User paulson # Date 1458136626 0 # Node ID de25474ce728ef8e4824b87c9f6dbf39973725da # Parent dbc62f86a1a9b95b7094d00f7581bd16a6cd03f8 Contractible sets. Also removal of obsolete theorems and refactoring diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Conditionally_Complete_Lattices.thy --- a/src/HOL/Conditionally_Complete_Lattices.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Conditionally_Complete_Lattices.thy Wed Mar 16 13:57:06 2016 +0000 @@ -686,4 +686,67 @@ by (rule order_antisym) qed +lemma cSup_abs_le: + fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" + shows "S \ {} \ (\x. x\S \ \x\ \ a) \ \Sup S\ \ a" + apply (auto simp add: abs_le_iff intro: cSup_least) + by (metis bdd_aboveI cSup_upper neg_le_iff_le order_trans) + +lemma cInf_abs_ge: + fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" + assumes "S \ {}" and bdd: "\x. x\S \ \x\ \ a" + shows "\Inf S\ \ a" +proof - + have "Sup (uminus ` S) = - (Inf S)" + proof (rule antisym) + show "- (Inf S) \ Sup(uminus ` S)" + apply (subst minus_le_iff) + apply (rule cInf_greatest [OF \S \ {}\]) + apply (subst minus_le_iff) + apply (rule cSup_upper, force) + using bdd apply (force simp add: abs_le_iff bdd_above_def) + done + next + show "Sup (uminus ` S) \ - Inf S" + apply (rule cSup_least) + using \S \ {}\ apply (force simp add: ) + apply clarsimp + apply (rule cInf_lower) + apply assumption + using bdd apply (simp add: bdd_below_def) + apply (rule_tac x="-a" in exI) + apply force + done + qed + with cSup_abs_le [of "uminus ` S"] assms show ?thesis by fastforce +qed + +lemma cSup_asclose: + fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" + assumes S: "S \ {}" + and b: "\x\S. \x - l\ \ e" + shows "\Sup S - l\ \ e" +proof - + have th: "\(x::'a) l e. \x - l\ \ e \ l - e \ x \ x \ l + e" + by arith + have "bdd_above S" + using b by (auto intro!: bdd_aboveI[of _ "l + e"]) + with S b show ?thesis + unfolding th by (auto intro!: cSup_upper2 cSup_least) +qed + +lemma cInf_asclose: + fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" + assumes S: "S \ {}" + and b: "\x\S. \x - l\ \ e" + shows "\Inf S - l\ \ e" +proof - + have th: "\(x::'a) l e. \x - l\ \ e \ l - e \ x \ x \ l + e" + by arith + have "bdd_below S" + using b by (auto intro!: bdd_belowI[of _ "l - e"]) + with S b show ?thesis + unfolding th by (auto intro!: cInf_lower2 cInf_greatest) +qed + end diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Library/Extended_Real.thy --- a/src/HOL/Library/Extended_Real.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Library/Extended_Real.thy Wed Mar 16 13:57:06 2016 +0000 @@ -12,15 +12,8 @@ imports Complex_Main Extended_Nat Liminf_Limsup begin -text \ - -This should be part of @{theory Extended_Nat} or @{theory Order_Continuity}, but then the -AFP-entry \Jinja_Thread\ fails, as it does overload certain named from @{theory Complex_Main}. - -\ - -lemma image_eqD: "f ` A = B \ \x\A. f x \ B" - by auto +text \This should be part of @{theory Extended_Nat} or @{theory Order_Continuity}, but then the +AFP-entry \Jinja_Thread\ fails, as it does overload certain named from @{theory Complex_Main}.\ lemma incseq_setsumI2: fixes f :: "'i \ nat \ 'a::ordered_comm_monoid_add" diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Wed Mar 16 13:57:06 2016 +0000 @@ -6286,7 +6286,13 @@ obtain B where B: "\x. B \ cmod x \ norm (f x) * 2 < cmod (f z)" by (auto simp: dist_norm) def R \ "1 + \B\ + norm z" - have "R > 0" unfolding R_def by (meson abs_add_one_gt_zero le_less_trans less_add_same_cancel2 norm_ge_zero) + have "R > 0" unfolding R_def + proof - + have "0 \ cmod z + \B\" + by (metis (full_types) add_nonneg_nonneg norm_ge_zero real_norm_def) + then show "0 < 1 + \B\ + cmod z" + by linarith + qed have *: "((\u. f u / (u - z)) has_contour_integral 2 * complex_of_real pi * \ * f z) (circlepath z R)" apply (rule Cauchy_integral_circlepath) using \R > 0\ apply (auto intro: holomorphic_on_subset [OF holf] holomorphic_on_imp_continuous_on)+ diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Wed Mar 16 13:57:06 2016 +0000 @@ -6377,11 +6377,14 @@ definition open_segment :: "'a::real_vector \ 'a \ 'a set" where "open_segment a b \ closed_segment a b - {a,b}" +lemmas segment = open_segment_def closed_segment_def + definition "between = (\(a,b) x. x \ closed_segment a b)" definition "starlike s \ (\a\s. \x\s. closed_segment a x \ s)" -lemmas segment = open_segment_def closed_segment_def +lemma starlike_UNIV [simp]: "starlike UNIV" + by (simp add: starlike_def) lemma midpoint_refl: "midpoint x x = x" unfolding midpoint_def @@ -6540,6 +6543,9 @@ lemma open_segment_idem [simp]: "open_segment a a = {}" by (simp add: open_segment_def) +lemma closed_segment_eq_open: "closed_segment a b = open_segment a b \ {a,b}" + using open_segment_def by auto + lemma closed_segment_eq_real_ivl: fixes a b::real shows "closed_segment a b = (if a \ b then {a .. b} else {b .. a})" @@ -7903,6 +7909,28 @@ lemmas rel_interior_segment = rel_interior_closed_segment rel_interior_open_segment +lemma starlike_convex_tweak_boundary_points: + fixes S :: "'a::euclidean_space set" + assumes "convex S" "S \ {}" and ST: "rel_interior S \ T" and TS: "T \ closure S" + shows "starlike T" +proof - + have "rel_interior S \ {}" + by (simp add: assms rel_interior_eq_empty) + then obtain a where a: "a \ rel_interior S" by blast + with ST have "a \ T" by blast + have *: "\x. x \ T \ open_segment a x \ rel_interior S" + apply (rule rel_interior_closure_convex_segment [OF \convex S\ a]) + using assms by blast + show ?thesis + unfolding starlike_def + apply (rule bexI [OF _ \a \ T\]) + apply (simp add: closed_segment_eq_open) + apply (intro conjI ballI a \a \ T\ rel_interior_closure_convex_segment [OF \convex S\ a]) + apply (simp add: order_trans [OF * ST]) + done +qed + +subsection\The relative frontier of a set\ definition "rel_frontier S = closure S - rel_interior S" diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Wed Mar 16 13:57:06 2016 +0000 @@ -11,79 +11,10 @@ "~~/src/HOL/Library/Indicator_Function" begin -lemma cSup_abs_le: (* TODO: move to Conditionally_Complete_Lattices.thy? *) - fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" - shows "S \ {} \ (\x. x\S \ \x\ \ a) \ \Sup S\ \ a" - apply (auto simp add: abs_le_iff intro: cSup_least) - by (metis bdd_aboveI cSup_upper neg_le_iff_le order_trans) - -lemma cInf_abs_ge: - fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" - assumes "S \ {}" and bdd: "\x. x\S \ \x\ \ a" - shows "\Inf S\ \ a" -proof - - have "Sup (uminus ` S) = - (Inf S)" - proof (rule antisym) - show "- (Inf S) \ Sup(uminus ` S)" - apply (subst minus_le_iff) - apply (rule cInf_greatest [OF \S \ {}\]) - apply (subst minus_le_iff) - apply (rule cSup_upper, force) - using bdd apply (force simp add: abs_le_iff bdd_above_def) - done - next - show "Sup (uminus ` S) \ - Inf S" - apply (rule cSup_least) - using \S \ {}\ apply (force simp add: ) - apply clarsimp - apply (rule cInf_lower) - apply assumption - using bdd apply (simp add: bdd_below_def) - apply (rule_tac x="-a" in exI) - apply force - done - qed - with cSup_abs_le [of "uminus ` S"] assms show ?thesis by fastforce -qed - -lemma cSup_asclose: - fixes S :: "('a::{linordered_idom,conditionally_complete_linorder}) set" - assumes S: "S \ {}" - and b: "\x\S. \x - l\ \ e" - shows "\Sup S - l\ \ e" -proof - - have th: "\(x::'a) l e. \x - l\ \ e \ l - e \ x \ x \ l + e" - by arith - have "bdd_above S" - using b by (auto intro!: bdd_aboveI[of _ "l + e"]) - with S b show ?thesis - unfolding th by (auto intro!: cSup_upper2 cSup_least) -qed - -lemma cInf_asclose: - fixes S :: "real set" - assumes S: "S \ {}" - and b: "\x\S. \x - l\ \ e" - shows "\Inf S - l\ \ e" -proof - - have "\- Sup (uminus ` S) - l\ = \Sup (uminus ` S) - (-l)\" - by auto - also have "\ \ e" - apply (rule cSup_asclose) - using abs_minus_add_cancel b by (auto simp add: S) - finally have "\- Sup (uminus ` S) - l\ \ e" . - then show ?thesis - by (simp add: Inf_real_def) -qed - lemmas scaleR_simps = scaleR_zero_left scaleR_minus_left scaleR_left_diff_distrib scaleR_zero_right scaleR_minus_right scaleR_right_diff_distrib scaleR_eq_0_iff scaleR_cancel_left scaleR_cancel_right scaleR_add_right scaleR_add_left real_vector_class.scaleR_one -lemma real_arch_invD: - "0 < (e::real) \ (\n::nat. n \ 0 \ 0 < inverse (real n) \ inverse (real n) < e)" - by (subst(asm) real_arch_inverse) - subsection \Sundries\ @@ -4595,6 +4526,10 @@ subsection \Uniform limit of integrable functions is integrable.\ +lemma real_arch_invD: + "0 < (e::real) \ (\n::nat. n \ 0 \ 0 < inverse (real n) \ inverse (real n) < e)" + by (subst(asm) real_arch_inverse) + lemma integrable_uniform_limit: fixes f :: "'a::euclidean_space \ 'b::banach" assumes "\e>0. \g. (\x\cbox a b. norm (f x - g x) \ e) \ g integrable_on cbox a b" diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Multivariate_Analysis/Path_Connected.thy --- a/src/HOL/Multivariate_Analysis/Path_Connected.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Path_Connected.thy Wed Mar 16 13:57:06 2016 +0000 @@ -3128,9 +3128,9 @@ done proposition homotopic_compose_continuous_left: - "homotopic_with (\f. True) X Y f g \ - continuous_on Y h \ image h Y \ Z - \ homotopic_with (\f. True) X Z (h o f) (h o g)" + "\homotopic_with (\_. True) X Y f g; + continuous_on Y h; h ` Y \ Z\ + \ homotopic_with (\f. True) X Z (h o f) (h o g)" using homotopic_with_compose_continuous_left by fastforce proposition homotopic_with_Pair: @@ -4053,4 +4053,267 @@ by (simp add: simply_connected_eq_contractible_loop_any pathfinish_def pathstart_def) qed +subsection\Contractible sets\ + +definition contractible where + "contractible S \ \a. homotopic_with (\x. True) S S id (\x. a)" + +proposition contractible_imp_simply_connected: + fixes S :: "_::real_normed_vector set" + assumes "contractible S" shows "simply_connected S" +proof (cases "S = {}") + case True then show ?thesis by force +next + case False + obtain a where a: "homotopic_with (\x. True) S S id (\x. a)" + using assms by (force simp add: contractible_def) + then have "a \ S" + by (metis False homotopic_constant_maps homotopic_with_symD homotopic_with_trans path_component_mem(2)) + show ?thesis + apply (simp add: simply_connected_eq_contractible_loop_all False) + apply (rule bexI [OF _ \a \ S\]) + using a apply (simp add: homotopic_loops_def homotopic_with_def path_def path_image_def pathfinish_def pathstart_def) + apply clarify + apply (rule_tac x="(h o (\y. (fst y, (p \ snd) y)))" in exI) + apply (intro conjI continuous_on_compose continuous_intros) + apply (erule continuous_on_subset | force)+ + done +qed + +corollary contractible_imp_connected: + fixes S :: "_::real_normed_vector set" + shows "contractible S \ connected S" +by (simp add: contractible_imp_simply_connected simply_connected_imp_connected) + +lemma contractible_imp_path_connected: + fixes S :: "_::real_normed_vector set" + shows "contractible S \ path_connected S" +by (simp add: contractible_imp_simply_connected simply_connected_imp_path_connected) + +lemma nullhomotopic_through_contractible: + fixes S :: "_::topological_space set" + assumes f: "continuous_on S f" "f ` S \ T" + and g: "continuous_on T g" "g ` T \ U" + and T: "contractible T" + obtains c where "homotopic_with (\h. True) S U (g o f) (\x. c)" +proof - + obtain b where b: "homotopic_with (\x. True) T T id (\x. b)" + using assms by (force simp add: contractible_def) + have "homotopic_with (\f. True) T U (g \ id) (g \ (\x. b))" + by (rule homotopic_compose_continuous_left [OF b g]) + then have "homotopic_with (\f. True) S U (g \ id \ f) (g \ (\x. b) \ f)" + by (rule homotopic_compose_continuous_right [OF _ f]) + then show ?thesis + by (simp add: comp_def that) +qed + +lemma nullhomotopic_into_contractible: + assumes f: "continuous_on S f" "f ` S \ T" + and T: "contractible T" + obtains c where "homotopic_with (\h. True) S T f (\x. c)" +apply (rule nullhomotopic_through_contractible [OF f, of id T]) +using assms +apply (auto simp: continuous_on_id) +done + +lemma nullhomotopic_from_contractible: + assumes f: "continuous_on S f" "f ` S \ T" + and S: "contractible S" + obtains c where "homotopic_with (\h. True) S T f (\x. c)" +apply (rule nullhomotopic_through_contractible [OF continuous_on_id _ f S, of S]) +using assms +apply (auto simp: comp_def) +done + +lemma homotopic_through_contractible: + fixes S :: "_::real_normed_vector set" + assumes "continuous_on S f1" "f1 ` S \ T" + "continuous_on T g1" "g1 ` T \ U" + "continuous_on S f2" "f2 ` S \ T" + "continuous_on T g2" "g2 ` T \ U" + "contractible T" "path_connected U" + shows "homotopic_with (\h. True) S U (g1 o f1) (g2 o f2)" +proof - + obtain c1 where c1: "homotopic_with (\h. True) S U (g1 o f1) (\x. c1)" + apply (rule nullhomotopic_through_contractible [of S f1 T g1 U]) + using assms apply (auto simp: ) + done + obtain c2 where c2: "homotopic_with (\h. True) S U (g2 o f2) (\x. c2)" + apply (rule nullhomotopic_through_contractible [of S f2 T g2 U]) + using assms apply (auto simp: ) + done + have *: "S = {} \ (\t. path_connected t \ t \ U \ c2 \ t \ c1 \ t)" + proof (cases "S = {}") + case True then show ?thesis by force + next + case False + with c1 c2 have "c1 \ U" "c2 \ U" + using homotopic_with_imp_subset2 all_not_in_conv image_subset_iff by blast+ + with \path_connected U\ show ?thesis by blast + qed + show ?thesis + apply (rule homotopic_with_trans [OF c1]) + apply (rule homotopic_with_symD) + apply (rule homotopic_with_trans [OF c2]) + apply (simp add: path_component homotopic_constant_maps *) + done +qed + +lemma homotopic_into_contractible: + fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set" + assumes f: "continuous_on S f" "f ` S \ T" + and g: "continuous_on S g" "g ` S \ T" + and T: "contractible T" + shows "homotopic_with (\h. True) S T f g" +using homotopic_through_contractible [of S f T id T g id] +by (simp add: assms contractible_imp_path_connected continuous_on_id) + +lemma homotopic_from_contractible: + fixes S :: "'a::real_normed_vector set" and T:: "'b::real_normed_vector set" + assumes f: "continuous_on S f" "f ` S \ T" + and g: "continuous_on S g" "g ` S \ T" + and "contractible S" "path_connected T" + shows "homotopic_with (\h. True) S T f g" +using homotopic_through_contractible [of S id S f T id g] +by (simp add: assms contractible_imp_path_connected continuous_on_id) + +lemma starlike_imp_contractible_gen: + fixes S :: "'a::real_normed_vector set" + assumes S: "starlike S" + and P: "\a T. \a \ S; 0 \ T; T \ 1\ \ P(\x. (1 - T) *\<^sub>R x + T *\<^sub>R a)" + obtains a where "homotopic_with P S S (\x. x) (\x. a)" +proof - + obtain a where "a \ S" and a: "\x. x \ S \ closed_segment a x \ S" + using S by (auto simp add: starlike_def) + have "(\y. (1 - fst y) *\<^sub>R snd y + fst y *\<^sub>R a) ` ({0..1} \ S) \ S" + apply clarify + apply (erule a [unfolded closed_segment_def, THEN subsetD]) + apply (simp add: ) + apply (metis add_diff_cancel_right' diff_ge_0_iff_ge le_add_diff_inverse pth_c(1)) + done + then show ?thesis + apply (rule_tac a="a" in that) + using \a \ S\ + apply (simp add: homotopic_with_def) + apply (rule_tac x="\y. (1 - (fst y)) *\<^sub>R snd y + (fst y) *\<^sub>R a" in exI) + apply (intro conjI ballI continuous_on_compose continuous_intros) + apply (simp_all add: P) + done +qed + +lemma starlike_imp_contractible: + fixes S :: "'a::real_normed_vector set" + shows "starlike S \ contractible S" +using starlike_imp_contractible_gen contractible_def by (fastforce simp: id_def) + +lemma contractible_UNIV: "contractible (UNIV :: 'a::real_normed_vector set)" + by (simp add: starlike_imp_contractible) + +lemma starlike_imp_simply_connected: + fixes S :: "'a::real_normed_vector set" + shows "starlike S \ simply_connected S" +by (simp add: contractible_imp_simply_connected starlike_imp_contractible) + +lemma convex_imp_simply_connected: + fixes S :: "'a::real_normed_vector set" + shows "convex S \ simply_connected S" +using convex_imp_starlike starlike_imp_simply_connected by blast + +lemma starlike_imp_path_connected: + fixes S :: "'a::real_normed_vector set" + shows "starlike S \ path_connected S" +by (simp add: simply_connected_imp_path_connected starlike_imp_simply_connected) + +lemma starlike_imp_connected: + fixes S :: "'a::real_normed_vector set" + shows "starlike S \ connected S" +by (simp add: path_connected_imp_connected starlike_imp_path_connected) + +lemma is_interval_simply_connected_1: + fixes S :: "real set" + shows "is_interval S \ simply_connected S" +using convex_imp_simply_connected is_interval_convex_1 is_interval_path_connected_1 simply_connected_imp_path_connected by auto + +lemma contractible_empty: "contractible {}" + by (simp add: continuous_on_empty contractible_def homotopic_with) + +lemma contractible_convex_tweak_boundary_points: + fixes S :: "'a::euclidean_space set" + assumes "convex S" and TS: "rel_interior S \ T" "T \ closure S" + shows "contractible T" +proof (cases "S = {}") + case True + with assms show ?thesis + by (simp add: contractible_empty subsetCE) +next + case False + show ?thesis + apply (rule starlike_imp_contractible) + apply (rule starlike_convex_tweak_boundary_points [OF \convex S\ False TS]) + done +qed + +lemma convex_imp_contractible: + fixes S :: "'a::real_normed_vector set" + shows "convex S \ contractible S" +using contractible_empty convex_imp_starlike starlike_imp_contractible by auto + +lemma contractible_sing: + fixes a :: "'a::real_normed_vector" + shows "contractible {a}" +by (rule convex_imp_contractible [OF convex_singleton]) + +lemma is_interval_contractible_1: + fixes S :: "real set" + shows "is_interval S \ contractible S" +using contractible_imp_simply_connected convex_imp_contractible is_interval_convex_1 + is_interval_simply_connected_1 by auto + +lemma contractible_times: + fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" + assumes S: "contractible S" and T: "contractible T" + shows "contractible (S \ T)" +proof - + obtain a h where conth: "continuous_on ({0..1} \ S) h" + and hsub: "h ` ({0..1} \ S) \ S" + and [simp]: "\x. x \ S \ h (0, x) = x" + and [simp]: "\x. x \ S \ h (1::real, x) = a" + using S by (auto simp add: contractible_def homotopic_with) + obtain b k where contk: "continuous_on ({0..1} \ T) k" + and ksub: "k ` ({0..1} \ T) \ T" + and [simp]: "\x. x \ T \ k (0, x) = x" + and [simp]: "\x. x \ T \ k (1::real, x) = b" + using T by (auto simp add: contractible_def homotopic_with) + show ?thesis + apply (simp add: contractible_def homotopic_with) + apply (rule exI [where x=a]) + apply (rule exI [where x=b]) + apply (rule exI [where x = "\z. (h (fst z, fst(snd z)), k (fst z, snd(snd z)))"]) + apply (intro conjI ballI continuous_intros continuous_on_compose2 [OF conth] continuous_on_compose2 [OF contk]) + using hsub ksub + apply (auto simp: ) + done +qed + +lemma homotopy_dominated_contractibility: + fixes S :: "'a::real_normed_vector set" and T :: "'b::real_normed_vector set" + assumes S: "contractible S" + and f: "continuous_on S f" "image f S \ T" + and g: "continuous_on T g" "image g T \ S" + and hom: "homotopic_with (\x. True) T T (f o g) id" + shows "contractible T" +proof - + obtain b where "homotopic_with (\h. True) S T f (\x. b)" + using nullhomotopic_from_contractible [OF f S] . + then have homg: "homotopic_with (\x. True) T T ((\x. b) \ g) (f \ g)" + by (rule homotopic_with_compose_continuous_right [OF homotopic_with_symD g]) + show ?thesis + apply (simp add: contractible_def) + apply (rule exI [where x = b]) + apply (rule homotopic_with_symD) + apply (rule homotopic_with_trans [OF _ hom]) + using homg apply (simp add: o_def) + done +qed + end diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Multivariate_Analysis/PolyRoots.thy --- a/src/HOL/Multivariate_Analysis/PolyRoots.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/PolyRoots.thy Wed Mar 16 13:57:06 2016 +0000 @@ -169,9 +169,13 @@ qed qed -lemma norm_lemma_xy: "\\b\ + 1 \ norm(y) - a; norm(x) \ a\ \ b \ norm(x + y)" - by (metis abs_add_one_not_less_self add.commute diff_le_eq dual_order.trans le_less_linear - norm_diff_ineq) +lemma norm_lemma_xy: assumes "\b\ + 1 \ norm(y) - a" "norm(x) \ a" shows "b \ norm(x + y)" +proof - + have "b \ norm y - norm x" + using assms by linarith + then show ?thesis + by (metis (no_types) add.commute norm_diff_ineq order_trans) +qed lemma polyfun_extremal: fixes c :: "nat \ 'a::real_normed_div_algebra" diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Real.thy --- a/src/HOL/Real.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Real.thy Wed Mar 16 13:57:06 2016 +0000 @@ -1404,21 +1404,6 @@ lemma real_sum_of_halves: "x/2 + x/2 = (x::real)" by simp -subsection\Absolute Value Function for the Reals\ - -lemma abs_minus_add_cancel: "\x + (- y)\ = \y + (- (x::real))\" - by (simp add: abs_if) - -lemma abs_add_one_gt_zero: "(0::real) < 1 + \x\" - by (simp add: abs_if) - -lemma abs_add_one_not_less_self: "~ \x\ + (1::real) < x" - by simp - -lemma abs_sum_triangle_ineq: "\(x::real) + y + (-l + -m)\ \ \x + -l\ + \y + -m\" - by simp - - subsection\Floor and Ceiling Functions from the Reals to the Integers\ (* FIXME: theorems for negative numerals. Many duplicates, e.g. from Archimedean_Field.thy. *) @@ -1564,7 +1549,7 @@ proof - have "x ^ n = of_int (\x\ ^ n)" using assms by (induct n arbitrary: x) simp_all - then show ?thesis by (metis floor_of_int) + then show ?thesis by (metis floor_of_int) qed lemma floor_numeral_power[simp]: diff -r dbc62f86a1a9 -r de25474ce728 src/HOL/Rings.thy --- a/src/HOL/Rings.thy Tue Mar 15 14:08:25 2016 +0000 +++ b/src/HOL/Rings.thy Wed Mar 16 13:57:06 2016 +0000 @@ -2088,6 +2088,9 @@ "\x - a\ \ r \ a - r \ x \ x \ a + r" by (auto simp add: diff_le_eq ac_simps abs_le_iff) +lemma abs_add_one_gt_zero: "0 < 1 + \x\" + by (force simp: abs_if not_less intro: zero_less_one add_strict_increasing less_trans) + end subsection \Dioids\