# HG changeset patch # User paulson # Date 1675698083 0 # Node ID 8f2e6186408f742cad316846deb482f0d7bdaf18 # Parent 7d7786585ab0d8dbd7ce56d8b5361c2d5e3a4401 Some more new material and some tidying of existing proofs diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Analysis/Complex_Analysis_Basics.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Complex_Analysis_Basics.thy Mon Feb 06 15:41:23 2023 +0000 @@ -6,7 +6,7 @@ text \Definitions of analytic and holomorphic functions, limit theorems, complex differentiation\ theory Complex_Analysis_Basics - imports Derivative "HOL-Library.Nonpos_Ints" + imports Derivative "HOL-Library.Nonpos_Ints" Uncountable_Sets begin subsection\<^marker>\tag unimportant\\General lemmas\ @@ -51,6 +51,50 @@ by (intro open_Collect_less closed_Collect_le closed_Collect_eq continuous_on_Re continuous_on_Im continuous_on_id continuous_on_const)+ +lemma uncountable_halfspace_Im_gt: "uncountable {z. Im z > c}" +proof - + obtain r where r: "r > 0" "ball ((c + 1) *\<^sub>R \) r \ {z. Im z > c}" + using open_halfspace_Im_gt[of c] unfolding open_contains_ball by force + then show ?thesis + using countable_subset uncountable_ball by blast +qed + +lemma uncountable_halfspace_Im_lt: "uncountable {z. Im z < c}" +proof - + obtain r where r: "r > 0" "ball ((c - 1) *\<^sub>R \) r \ {z. Im z < c}" + using open_halfspace_Im_lt[of c] unfolding open_contains_ball by force + then show ?thesis + using countable_subset uncountable_ball by blast +qed + +lemma uncountable_halfspace_Re_gt: "uncountable {z. Re z > c}" +proof - + obtain r where r: "r > 0" "ball (of_real(c + 1)) r \ {z. Re z > c}" + using open_halfspace_Re_gt[of c] unfolding open_contains_ball by force + then show ?thesis + using countable_subset uncountable_ball by blast +qed + +lemma uncountable_halfspace_Re_lt: "uncountable {z. Re z < c}" +proof - + obtain r where r: "r > 0" "ball (of_real(c - 1)) r \ {z. Re z < c}" + using open_halfspace_Re_lt[of c] unfolding open_contains_ball by force + then show ?thesis + using countable_subset uncountable_ball by blast +qed + +lemma connected_halfspace_Im_gt [intro]: "connected {z. c < Im z}" + by (intro convex_connected convex_halfspace_Im_gt) + +lemma connected_halfspace_Im_lt [intro]: "connected {z. c > Im z}" + by (intro convex_connected convex_halfspace_Im_lt) + +lemma connected_halfspace_Re_gt [intro]: "connected {z. c < Re z}" + by (intro convex_connected convex_halfspace_Re_gt) + +lemma connected_halfspace_Re_lt [intro]: "connected {z. c > Re z}" + by (intro convex_connected convex_halfspace_Re_lt) + lemma closed_complex_Reals: "closed (\ :: complex set)" proof - have "(\ :: complex set) = {z. Im z = 0}" diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Mon Feb 06 15:41:23 2023 +0000 @@ -84,6 +84,41 @@ "f holomorphic_on s \ (\x. exp (f x)) holomorphic_on s" using holomorphic_on_compose[OF _ holomorphic_on_exp] by (simp add: o_def) +lemma exp_analytic_on [analytic_intros]: + assumes "f analytic_on A" + shows "(\z. exp (f z)) analytic_on A" + by (metis analytic_on_holomorphic assms holomorphic_on_exp') + +lemma + assumes "\w. w \ A \ exp (f w) = w" + assumes "f holomorphic_on A" "z \ A" "open A" + shows deriv_complex_logarithm: "deriv f z = 1 / z" + and has_field_derivative_complex_logarithm: "(f has_field_derivative 1 / z) (at z)" +proof - + have [simp]: "z \ 0" + using assms(1)[of z] assms(3) by auto + have deriv [derivative_intros]: "(f has_field_derivative deriv f z) (at z)" + using assms holomorphic_derivI by blast + have "((\w. w) has_field_derivative 1) (at z)" + by (intro derivative_intros) + also have "?this \ ((\w. exp (f w)) has_field_derivative 1) (at z)" + proof (rule DERIV_cong_ev) + have "eventually (\w. w \ A) (nhds z)" + using assms by (intro eventually_nhds_in_open) auto + thus "eventually (\w. w = exp (f w)) (nhds z)" + by eventually_elim (use assms in auto) + qed auto + finally have "((\w. exp (f w)) has_field_derivative 1) (at z)" . + moreover have "((\w. exp (f w)) has_field_derivative exp (f z) * deriv f z) (at z)" + by (rule derivative_eq_intros refl)+ + ultimately have "exp (f z) * deriv f z = 1" + using DERIV_unique by blast + with assms show "deriv f z = 1 / z" + by (simp add: field_simps) + with deriv show "(f has_field_derivative 1 / z) (at z)" + by simp +qed + subsection\Euler and de Moivre formulas\ text\The sine series times \<^term>\i\\ @@ -2602,6 +2637,9 @@ lemma norm_powr_real: "w \ \ \ 0 < Re w \ norm(w powr z) = exp(Re z * ln(Re w))" using Ln_Reals_eq norm_exp_eq_Re by (auto simp: Im_Ln_eq_0 powr_def norm_complex_def) +lemma norm_powr_real_powr': "w \ \ \ norm (z powr w) = norm z powr Re w" + by (auto simp: powr_def Reals_def) + lemma powr_complexpow [simp]: fixes x::complex shows "x \ 0 \ x powr (of_nat n) = x^n" by (induct n) (auto simp: ac_simps powr_add) diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Continuum_Not_Denumerable.thy --- a/src/HOL/Analysis/Continuum_Not_Denumerable.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Continuum_Not_Denumerable.thy Mon Feb 06 15:41:23 2023 +0000 @@ -176,9 +176,7 @@ qed lemma uncountable_closed_interval: "uncountable {a..b} \ a < b" for a b :: real - apply (rule iffI) - apply (metis atLeastAtMost_singleton atLeastatMost_empty countable_finite finite.emptyI finite_insert linorder_neqE_linordered_idom) - using real_interval_avoid_countable_set by fastforce + using infinite_Icc_iff by (fastforce dest: countable_finite real_interval_avoid_countable_set) lemma open_minus_countable: fixes S A :: "real set" diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Elementary_Topology.thy Mon Feb 06 15:41:23 2023 +0000 @@ -618,31 +618,18 @@ lemma islimpt_Un: "x islimpt (S \ T) \ x islimpt S \ x islimpt T" by (simp add: islimpt_iff_eventually eventually_conj_iff) +lemma islimpt_finite_union_iff: + assumes "finite A" + shows "z islimpt (\x\A. B x) \ (\x\A. z islimpt B x)" + using assms by (induction rule: finite_induct) (simp_all add: islimpt_Un) lemma islimpt_insert: fixes x :: "'a::t1_space" shows "x islimpt (insert a s) \ x islimpt s" proof - assume *: "x islimpt (insert a s)" - show "x islimpt s" - proof (rule islimptI) - fix t - assume t: "x \ t" "open t" - show "\y\s. y \ t \ y \ x" - proof (cases "x = a") - case True - obtain y where "y \ insert a s" "y \ t" "y \ x" - using * t by (rule islimptE) - with \x = a\ show ?thesis by auto - next - case False - with t have t': "x \ t - {a}" "open (t - {a})" - by (simp_all add: open_Diff) - obtain y where "y \ insert a s" "y \ t - {a}" "y \ x" - using * t' by (rule islimptE) - then show ?thesis by auto - qed - qed + assume "x islimpt (insert a s)" + then show "x islimpt s" + by (metis closed_limpt closed_singleton empty_iff insert_iff insert_is_Un islimpt_Un islimpt_def) next assume "x islimpt s" then show "x islimpt (insert a s)" diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Homeomorphism.thy --- a/src/HOL/Analysis/Homeomorphism.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Homeomorphism.thy Mon Feb 06 15:41:23 2023 +0000 @@ -1017,6 +1017,14 @@ pairwise disjnt v \ (\u \ v. \q. homeomorphism u T p q)))" +lemma covering_spaceI [intro?]: + assumes "continuous_on c p" "p ` c = S" + "\x. x \ S \ \T. x \ T \ openin (top_of_set S) T \ + (\v. \v = c \ p -` T \ (\u \ v. openin (top_of_set c) u) \ + pairwise disjnt v \ (\u \ v. \q. homeomorphism u T p q))" + shows "covering_space c p S" + using assms unfolding covering_space_def by auto + lemma covering_space_imp_continuous: "covering_space c p S \ continuous_on c p" by (simp add: covering_space_def) diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Homotopy.thy --- a/src/HOL/Analysis/Homotopy.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Homotopy.thy Mon Feb 06 15:41:23 2023 +0000 @@ -5,7 +5,7 @@ section \Homotopy of Maps\ theory Homotopy - imports Path_Connected Continuum_Not_Denumerable Product_Topology + imports Path_Connected Product_Topology Uncountable_Sets begin definition\<^marker>\tag important\ homotopic_with @@ -4169,144 +4169,16 @@ by blast qed - -subsection\<^marker>\tag unimportant\\Some Uncountable Sets\ - -lemma uncountable_closed_segment: - fixes a :: "'a::real_normed_vector" - assumes "a \ b" shows "uncountable (closed_segment a b)" -unfolding path_image_linepath [symmetric] path_image_def - using inj_on_linepath [OF assms] uncountable_closed_interval [of 0 1] - countable_image_inj_on by auto - -lemma uncountable_open_segment: - fixes a :: "'a::real_normed_vector" - assumes "a \ b" shows "uncountable (open_segment a b)" - by (simp add: assms open_segment_def uncountable_closed_segment uncountable_minus_countable) - -lemma uncountable_convex: - fixes a :: "'a::real_normed_vector" - assumes "convex S" "a \ S" "b \ S" "a \ b" - shows "uncountable S" -proof - - have "uncountable (closed_segment a b)" - by (simp add: uncountable_closed_segment assms) - then show ?thesis - by (meson assms convex_contains_segment countable_subset) -qed - -lemma uncountable_ball: - fixes a :: "'a::euclidean_space" - assumes "r > 0" - shows "uncountable (ball a r)" -proof - - have "uncountable (open_segment a (a + r *\<^sub>R (SOME i. i \ Basis)))" - by (metis Basis_zero SOME_Basis add_cancel_right_right assms less_le scale_eq_0_iff uncountable_open_segment) - moreover have "open_segment a (a + r *\<^sub>R (SOME i. i \ Basis)) \ ball a r" - using assms by (auto simp: in_segment algebra_simps dist_norm SOME_Basis) - ultimately show ?thesis - by (metis countable_subset) -qed - -lemma ball_minus_countable_nonempty: - assumes "countable (A :: 'a :: euclidean_space set)" "r > 0" - shows "ball z r - A \ {}" -proof - assume *: "ball z r - A = {}" - have "uncountable (ball z r - A)" - by (intro uncountable_minus_countable assms uncountable_ball) - thus False by (subst (asm) *) auto -qed - -lemma uncountable_cball: - fixes a :: "'a::euclidean_space" - assumes "r > 0" - shows "uncountable (cball a r)" - using assms countable_subset uncountable_ball by auto - -lemma pairwise_disjnt_countable: - fixes \ :: "nat set set" - assumes "pairwise disjnt \" - shows "countable \" -proof - - have "inj_on (\X. SOME n. n \ X) (\ - {{}})" - by (clarsimp simp: inj_on_def) (metis assms disjnt_iff pairwiseD some_in_eq) - then show ?thesis - by (metis countable_Diff_eq countable_def) -qed - -lemma pairwise_disjnt_countable_Union: - assumes "countable (\\)" and pwd: "pairwise disjnt \" - shows "countable \" -proof - - obtain f :: "_ \ nat" where f: "inj_on f (\\)" - using assms by blast - then have "pairwise disjnt (\ X \ \. {f ` X})" - using assms by (force simp: pairwise_def disjnt_inj_on_iff [OF f]) - then have "countable (\ X \ \. {f ` X})" - using pairwise_disjnt_countable by blast - then show ?thesis - by (meson pwd countable_image_inj_on disjoint_image f inj_on_image pairwise_disjnt_countable) -qed - -lemma connected_uncountable: +lemma connected_card_eq_iff_nontrivial: fixes S :: "'a::metric_space set" - assumes "connected S" "a \ S" "b \ S" "a \ b" shows "uncountable S" -proof - - have "continuous_on S (dist a)" - by (intro continuous_intros) - then have "connected (dist a ` S)" - by (metis connected_continuous_image \connected S\) - then have "closed_segment 0 (dist a b) \ (dist a ` S)" - by (simp add: assms closed_segment_subset is_interval_connected_1 is_interval_convex) - then have "uncountable (dist a ` S)" - by (metis \a \ b\ countable_subset dist_eq_0_iff uncountable_closed_segment) - then show ?thesis - by blast -qed - -lemma path_connected_uncountable: - fixes S :: "'a::metric_space set" - assumes "path_connected S" "a \ S" "b \ S" "a \ b" shows "uncountable S" - using path_connected_imp_connected assms connected_uncountable by metis + shows "connected S \ uncountable S \ \(\a. S \ {a})" + by (metis connected_uncountable finite.emptyI finite.insertI rev_finite_subset singleton_iff subsetI uncountable_infinite) lemma connected_finite_iff_sing: fixes S :: "'a::metric_space set" assumes "connected S" - shows "finite S \ S = {} \ (\a. S = {a})" (is "_ = ?rhs") -proof - - have "uncountable S" if "\ ?rhs" - using connected_uncountable assms that by blast - then show ?thesis - using uncountable_infinite by auto -qed - -lemma connected_card_eq_iff_nontrivial: - fixes S :: "'a::metric_space set" - shows "connected S \ uncountable S \ \(\a. S \ {a})" - by (metis connected_uncountable finite.emptyI finite.insertI rev_finite_subset singleton_iff subsetI uncountable_infinite) - -lemma simple_path_image_uncountable: - fixes g :: "real \ 'a::metric_space" - assumes "simple_path g" - shows "uncountable (path_image g)" -proof - - have "g 0 \ path_image g" "g (1/2) \ path_image g" - by (simp_all add: path_defs) - moreover have "g 0 \ g (1/2)" - using assms by (fastforce simp add: simple_path_def loop_free_def) - ultimately have "\a. \ path_image g \ {a}" - by blast - then show ?thesis - using assms connected_simple_path_image connected_uncountable by blast -qed - -lemma arc_image_uncountable: - fixes g :: "real \ 'a::metric_space" - assumes "arc g" - shows "uncountable (path_image g)" - by (simp add: arc_imp_simple_path assms simple_path_image_uncountable) - + shows "finite S \ S = {} \ (\a. S = {a})" + using assms connected_uncountable countable_finite by blast subsection\<^marker>\tag unimportant\\ Some simple positive connection theorems\ diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Isolated.thy --- a/src/HOL/Analysis/Isolated.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Analysis/Isolated.thy Mon Feb 06 15:41:23 2023 +0000 @@ -3,49 +3,49 @@ begin -subsection \Isolate and discrete\ - -definition (in topological_space) isolate:: "'a \ 'a set \ bool" (infixr "isolate" 60) - where "x isolate S \ (x\S \ (\T. open T \ T \ S = {x}))" - -definition (in topological_space) discrete:: "'a set \ bool" - where "discrete S \ (\x\S. x isolate S)" - +subsection \Isolate and discrete\ + +definition (in topological_space) isolated_in:: "'a \ 'a set \ bool" (infixr "isolated'_in" 60) + where "x isolated_in S \ (x\S \ (\T. open T \ T \ S = {x}))" + +definition (in topological_space) discrete:: "'a set \ bool" + where "discrete S \ (\x\S. x isolated_in S)" + definition (in metric_space) uniform_discrete :: "'a set \ bool" where "uniform_discrete S \ (\e>0. \x\S. \y\S. dist x y < e \ x = y)" - + lemma uniformI1: assumes "e>0" "\x y. \x\S;y\S;dist x y \ x =y " - shows "uniform_discrete S" + shows "uniform_discrete S" unfolding uniform_discrete_def using assms by auto lemma uniformI2: assumes "e>0" "\x y. \x\S;y\S;x\y\ \ dist x y\e " - shows "uniform_discrete S" + shows "uniform_discrete S" unfolding uniform_discrete_def using assms not_less by blast - -lemma isolate_islimpt_iff:"(x isolate S) \ (\ (x islimpt S) \ x\S)" - unfolding isolate_def islimpt_def by auto - -lemma isolate_dist_Ex_iff: + +lemma isolated_in_islimpt_iff:"(x isolated_in S) \ (\ (x islimpt S) \ x\S)" + unfolding isolated_in_def islimpt_def by auto + +lemma isolated_in_dist_Ex_iff: fixes x::"'a::metric_space" - shows "x isolate S \ (x\S \ (\e>0. \y\S. dist x y < e \ y=x))" -unfolding isolate_islimpt_iff islimpt_approachable by (metis dist_commute) - + shows "x isolated_in S \ (x\S \ (\e>0. \y\S. dist x y < e \ y=x))" +unfolding isolated_in_islimpt_iff islimpt_approachable by (metis dist_commute) + lemma discrete_empty[simp]: "discrete {}" unfolding discrete_def by auto lemma uniform_discrete_empty[simp]: "uniform_discrete {}" unfolding uniform_discrete_def by (simp add: gt_ex) - -lemma isolate_insert: + +lemma isolated_in_insert: fixes x :: "'a::t1_space" - shows "x isolate (insert a S) \ x isolate S \ (x=a \ \ (x islimpt S))" -by (meson insert_iff islimpt_insert isolate_islimpt_iff) - + shows "x isolated_in (insert a S) \ x isolated_in S \ (x=a \ \ (x islimpt S))" +by (meson insert_iff islimpt_insert isolated_in_islimpt_iff) + (* -TODO. -Other than +TODO. +Other than uniform_discrete S \ discrete S uniform_discrete S \ closed S @@ -58,31 +58,31 @@ http://topology.auburn.edu/tp/reprints/v30/tp30120.pdf http://msp.org/pjm/1959/9-2/pjm-v9-n2-p19-s.pdf -*) - +*) + lemma uniform_discrete_imp_closed: - "uniform_discrete S \ closed S" - by (meson discrete_imp_closed uniform_discrete_def) - + "uniform_discrete S \ closed S" + by (meson discrete_imp_closed uniform_discrete_def) + lemma uniform_discrete_imp_discrete: "uniform_discrete S \ discrete S" - by (metis discrete_def isolate_dist_Ex_iff uniform_discrete_def) - -lemma isolate_subset:"x isolate S \ T \ S \ x\T \ x isolate T" - unfolding isolate_def by fastforce + by (metis discrete_def isolated_in_dist_Ex_iff uniform_discrete_def) + +lemma isolated_in_subset:"x isolated_in S \ T \ S \ x\T \ x isolated_in T" + unfolding isolated_in_def by fastforce lemma discrete_subset[elim]: "discrete S \ T \ S \ discrete T" - unfolding discrete_def using islimpt_subset isolate_islimpt_iff by blast - + unfolding discrete_def using islimpt_subset isolated_in_islimpt_iff by blast + lemma uniform_discrete_subset[elim]: "uniform_discrete S \ T \ S \ uniform_discrete T" by (meson subsetD uniform_discrete_def) - -lemma continuous_on_discrete: "discrete S \ continuous_on S f" - unfolding continuous_on_topological by (metis discrete_def islimptI isolate_islimpt_iff) - + +lemma continuous_on_discrete: "discrete S \ continuous_on S f" + unfolding continuous_on_topological by (metis discrete_def islimptI isolated_in_islimpt_iff) + lemma uniform_discrete_insert: "uniform_discrete (insert a S) \ uniform_discrete S" -proof - assume asm:"uniform_discrete S" +proof + assume asm:"uniform_discrete S" let ?thesis = "uniform_discrete (insert a S)" have ?thesis when "a\S" using that asm by (simp add: insert_absorb) moreover have ?thesis when "S={}" using that asm by (simp add: uniform_discrete_def) @@ -94,44 +94,38 @@ have "closed S" using asm uniform_discrete_imp_closed by auto then have "e2>0" by (smt (verit) \0 < e1\ e2_def infdist_eq_setdist infdist_pos_not_in_closed that) - moreover have "x = y" when "x\insert a S" "y\insert a S" "dist x y < e2 " for x y - proof - - have ?thesis when "x=a" "y=a" using that by auto - moreover have ?thesis when "x=a" "y\S" - using that setdist_le_dist[of x "{a}" y S] \dist x y < e2\ unfolding e2_def - by fastforce - moreover have ?thesis when "y=a" "x\S" - using that setdist_le_dist[of y "{a}" x S] \dist x y < e2\ unfolding e2_def - by (simp add: dist_commute) - moreover have ?thesis when "x\S" "y\S" - using e1_dist[rule_format, OF that] \dist x y < e2\ unfolding e2_def - by (simp add: dist_commute) - ultimately show ?thesis using that by auto + moreover have "x = y" if "x\insert a S" "y\insert a S" "dist x y < e2" for x y + proof (cases "x=a \ y=a") + case True then show ?thesis + by (smt (verit, best) dist_commute e2_def infdist_eq_setdist infdist_le insertE that) + next + case False then show ?thesis + using e1_dist e2_def that by force qed ultimately show ?thesis unfolding uniform_discrete_def by meson qed ultimately show ?thesis by auto qed (simp add: subset_insertI uniform_discrete_subset) - + lemma discrete_compact_finite_iff: fixes S :: "'a::t1_space set" shows "discrete S \ compact S \ finite S" -proof +proof assume "finite S" then have "compact S" using finite_imp_compact by auto moreover have "discrete S" - unfolding discrete_def using isolate_islimpt_iff islimpt_finite[OF \finite S\] by auto + unfolding discrete_def using isolated_in_islimpt_iff islimpt_finite[OF \finite S\] by auto ultimately show "discrete S \ compact S" by auto next assume "discrete S \ compact S" - then show "finite S" - by (meson discrete_def Heine_Borel_imp_Bolzano_Weierstrass isolate_islimpt_iff order_refl) + then show "finite S" + by (meson discrete_def Heine_Borel_imp_Bolzano_Weierstrass isolated_in_islimpt_iff order_refl) qed - + lemma uniform_discrete_finite_iff: fixes S :: "'a::heine_borel set" shows "uniform_discrete S \ bounded S \ finite S" -proof +proof assume "uniform_discrete S \ bounded S" then have "discrete S" "compact S" using uniform_discrete_imp_discrete uniform_discrete_imp_closed compact_eq_bounded_closed @@ -145,46 +139,42 @@ proof - have "\x. \d>0. \y\S. y \ x \ d \ dist x y" using finite_set_avoid[OF \finite S\] by auto - then obtain f where f_pos:"f x>0" + then obtain f where f_pos:"f x>0" and f_dist: "\y\S. y \ x \ f x \ dist x y" - if "x\S" for x + if "x\S" for x by metis - define f_min where "f_min \ Min (f ` S)" + define f_min where "f_min \ Min (f ` S)" have "f_min > 0" - unfolding f_min_def + unfolding f_min_def by (simp add: asm f_pos that) moreover have "\x\S. \y\S. f_min > dist x y \ x=y" - using f_dist unfolding f_min_def - by (metis Min_gr_iff all_not_in_conv asm dual_order.irrefl eq_iff finite_imageI imageI - less_eq_real_def) - ultimately have "uniform_discrete S" + using f_dist unfolding f_min_def + by (metis Min_le asm finite_imageI imageI le_less_trans linorder_not_less) + ultimately have "uniform_discrete S" unfolding uniform_discrete_def by auto moreover have "bounded S" using \finite S\ by auto ultimately show ?thesis by auto qed ultimately show ?thesis by blast qed - + lemma uniform_discrete_image_scale: assumes "uniform_discrete S" and dist:"\x\S. \y\S. dist x y = c * dist (f x) (f y)" - shows "uniform_discrete (f ` S)" + shows "uniform_discrete (f ` S)" proof - have ?thesis when "S={}" using that by auto moreover have ?thesis when "S\{}" "c\0" proof - obtain x1 where "x1\S" using \S\{}\ by auto have ?thesis when "S-{x1} = {}" - proof - - have "S={x1}" using that \S\{}\ by auto - then show ?thesis using uniform_discrete_insert[of "f x1"] by auto - qed + using \x1 \ S\ subset_antisym that uniform_discrete_insert by fastforce moreover have ?thesis when "S-{x1} \ {}" proof - obtain x2 where "x2\S-{x1}" using \S-{x1} \ {}\ by auto then have "x2\S" "x1\x2" by auto then have "dist x1 x2 > 0" by auto moreover have "dist x1 x2 = c * dist (f x1) (f x2)" - using dist[rule_format, OF \x1\S\ \x2\S\] . + by (simp add: \x1 \ S\ \x2 \ S\ dist) moreover have "dist (f x2) (f x2) \ 0" by auto ultimately have False using \c\0\ by (simp add: zero_less_mult_iff) then show ?thesis by auto @@ -195,21 +185,13 @@ proof - obtain e1 where "e1>0" and e1_dist:"\x\S. \y\S. dist y x < e1 \ y = x" using \uniform_discrete S\ unfolding uniform_discrete_def by auto - define e where "e= e1/c" - have "x1 = x2" when "x1\ f ` S" "x2\ f ` S" "dist x1 x2 < e " for x1 x2 - proof - - obtain y1 where y1:"y1\S" "x1=f y1" using \x1\ f ` S\ by auto - obtain y2 where y2:"y2\S" "x2=f y2" using \x2\ f ` S\ by auto - have "dist y1 y2 < e1" - by (smt (verit) \0 < c\ dist divide_right_mono e_def nonzero_mult_div_cancel_left that(3) y1 y2) - then have "y1=y2" - using e1_dist[rule_format, OF y2(1) y1(1)] by simp - then show "x1=x2" using y1(2) y2(2) by auto - qed + define e where "e \ e1/c" + have "x1 = x2" when "x1 \ f ` S" "x2 \ f ` S" and d: "dist x1 x2 < e" for x1 x2 + by (smt (verit) \0 < c\ d dist divide_right_mono e1_dist e_def imageE nonzero_mult_div_cancel_left that) moreover have "e>0" using \e1>0\ \c>0\ unfolding e_def by auto ultimately show ?thesis unfolding uniform_discrete_def by meson qed ultimately show ?thesis by fastforce qed - + end diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Analysis/Uncountable_Sets.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Analysis/Uncountable_Sets.thy Mon Feb 06 15:41:23 2023 +0000 @@ -0,0 +1,121 @@ +section \Some Uncountable Sets\ + +theory Uncountable_Sets + imports Path_Connected Continuum_Not_Denumerable +begin + +lemma uncountable_closed_segment: + fixes a :: "'a::real_normed_vector" + assumes "a \ b" shows "uncountable (closed_segment a b)" +unfolding path_image_linepath [symmetric] path_image_def + using inj_on_linepath [OF assms] uncountable_closed_interval [of 0 1] + countable_image_inj_on by auto + +lemma uncountable_open_segment: + fixes a :: "'a::real_normed_vector" + assumes "a \ b" shows "uncountable (open_segment a b)" + by (simp add: assms open_segment_def uncountable_closed_segment uncountable_minus_countable) + +lemma uncountable_convex: + fixes a :: "'a::real_normed_vector" + assumes "convex S" "a \ S" "b \ S" "a \ b" + shows "uncountable S" +proof - + have "uncountable (closed_segment a b)" + by (simp add: uncountable_closed_segment assms) + then show ?thesis + by (meson assms convex_contains_segment countable_subset) +qed + +lemma uncountable_ball: + fixes a :: "'a::euclidean_space" + assumes "r > 0" + shows "uncountable (ball a r)" +proof - + have "uncountable (open_segment a (a + r *\<^sub>R (SOME i. i \ Basis)))" + by (metis Basis_zero SOME_Basis add_cancel_right_right assms less_le scale_eq_0_iff uncountable_open_segment) + moreover have "open_segment a (a + r *\<^sub>R (SOME i. i \ Basis)) \ ball a r" + using assms by (auto simp: in_segment algebra_simps dist_norm SOME_Basis) + ultimately show ?thesis + by (metis countable_subset) +qed + +lemma ball_minus_countable_nonempty: + assumes "countable (A :: 'a :: euclidean_space set)" "r > 0" + shows "ball z r - A \ {}" +proof + assume *: "ball z r - A = {}" + have "uncountable (ball z r - A)" + by (intro uncountable_minus_countable assms uncountable_ball) + thus False by (subst (asm) *) auto +qed + +lemma uncountable_cball: + fixes a :: "'a::euclidean_space" + assumes "r > 0" + shows "uncountable (cball a r)" + using assms countable_subset uncountable_ball by auto + +lemma pairwise_disjnt_countable: + fixes \ :: "nat set set" + assumes "pairwise disjnt \" + shows "countable \" + by (simp add: assms countable_disjoint_open_subsets open_discrete) + +lemma pairwise_disjnt_countable_Union: + assumes "countable (\\)" and pwd: "pairwise disjnt \" + shows "countable \" +proof - + obtain f :: "_ \ nat" where f: "inj_on f (\\)" + using assms by blast + then have "pairwise disjnt (\ X \ \. {f ` X})" + using assms by (force simp: pairwise_def disjnt_inj_on_iff [OF f]) + then have "countable (\ X \ \. {f ` X})" + using pairwise_disjnt_countable by blast + then show ?thesis + by (meson pwd countable_image_inj_on disjoint_image f inj_on_image pairwise_disjnt_countable) +qed + +lemma connected_uncountable: + fixes S :: "'a::metric_space set" + assumes "connected S" "a \ S" "b \ S" "a \ b" shows "uncountable S" +proof - + have "continuous_on S (dist a)" + by (intro continuous_intros) + then have "connected (dist a ` S)" + by (metis connected_continuous_image \connected S\) + then have "closed_segment 0 (dist a b) \ (dist a ` S)" + by (simp add: assms closed_segment_subset is_interval_connected_1 is_interval_convex) + then have "uncountable (dist a ` S)" + by (metis \a \ b\ countable_subset dist_eq_0_iff uncountable_closed_segment) + then show ?thesis + by blast +qed + +lemma path_connected_uncountable: + fixes S :: "'a::metric_space set" + assumes "path_connected S" "a \ S" "b \ S" "a \ b" shows "uncountable S" + using path_connected_imp_connected assms connected_uncountable by metis + +lemma simple_path_image_uncountable: + fixes g :: "real \ 'a::metric_space" + assumes "simple_path g" + shows "uncountable (path_image g)" +proof - + have "g 0 \ path_image g" "g (1/2) \ path_image g" + by (simp_all add: path_defs) + moreover have "g 0 \ g (1/2)" + using assms by (fastforce simp add: simple_path_def loop_free_def) + ultimately have "\a. \ path_image g \ {a}" + by blast + then show ?thesis + using assms connected_simple_path_image connected_uncountable by blast +qed + +lemma arc_image_uncountable: + fixes g :: "real \ 'a::metric_space" + assumes "arc g" + shows "uncountable (path_image g)" + by (simp add: arc_imp_simple_path assms simple_path_image_uncountable) + +end diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Library/Landau_Symbols.thy --- a/src/HOL/Library/Landau_Symbols.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Library/Landau_Symbols.thy Mon Feb 06 15:41:23 2023 +0000 @@ -618,7 +618,48 @@ lemmas mult = big_mult small_big_mult big_small_mult small_mult +lemma big_power: + assumes "f \ L F (g)" + shows "(\x. f x ^ m) \ L F (\x. g x ^ m)" + using assms by (induction m) (auto intro: mult) +lemma (in landau_pair) small_power: + assumes "f \ l F (g)" "m > 0" + shows "(\x. f x ^ m) \ l F (\x. g x ^ m)" +proof - + have "(\x. f x * f x ^ (m - 1)) \ l F (\x. g x * g x ^ (m - 1))" + by (intro small_big_mult assms big_power[OF small_imp_big]) + thus ?thesis + using assms by (cases m) (simp_all add: mult_ac) +qed + +lemma big_power_increasing: + assumes "(\_. 1) \ L F f" "m \ n" + shows "(\x. f x ^ m) \ L F (\x. f x ^ n)" +proof - + have "(\x. f x ^ m * 1 ^ (n - m)) \ L F (\x. f x ^ m * f x ^ (n - m))" + using assms by (intro mult big_power) auto + also have "(\x. f x ^ m * f x ^ (n - m)) = (\x. f x ^ (m + (n - m)))" + by (subst power_add [symmetric]) (rule refl) + also have "m + (n - m) = n" + using assms by simp + finally show ?thesis by simp +qed + +lemma small_power_increasing: + assumes "(\_. 1) \ l F f" "m < n" + shows "(\x. f x ^ m) \ l F (\x. f x ^ n)" +proof - + note [trans] = small_big_trans + have "(\x. f x ^ m * 1) \ l F (\x. f x ^ m * f x)" + using assms by (intro big_small_mult) auto + also have "(\x. f x ^ m * f x) = (\x. f x ^ Suc m)" + by (simp add: mult_ac) + also have "\ \ L F (\x. f x ^ n)" + using assms by (intro big_power_increasing[OF small_imp_big]) auto + finally show ?thesis by simp +qed + sublocale big: landau_symbol L L' Lr proof have L: "L = bigo \ L = bigomega" @@ -1779,6 +1820,9 @@ by (intro asymp_equivI tendsto_eventually) (insert assms, auto elim!: eventually_mono) +lemma asymp_equiv_nhds_iff: "f \[nhds (z :: 'a :: t1_space)] g \ f \[at z] g \ f z = g z" + by (auto simp: asymp_equiv_def tendsto_nhds_iff) + lemma asymp_equiv_sandwich: fixes f g h :: "'a \ 'b :: {real_normed_field, order_topology, linordered_field}" assumes "eventually (\x. f x \ 0) F" @@ -2191,8 +2235,6 @@ assumes "l1 \[F] u1" "u1 \[F] l2" "l2 \[F] u2" "eventually (\x. f x \ {l1 x..u1 x}) F" "eventually (\x. g x \ {l2 x..u2 x}) F" shows "f \[F] g" - by (rule asymp_equiv_sandwich_real[OF asymp_equiv_sandwich_real'[OF _ _ assms(5)] - asymp_equiv_sandwich_real'[OF _ _ assms(5)] assms(4)]; - blast intro: asymp_equiv_trans assms(1,2,3))+ + by (meson assms asymp_equiv_sandwich_real asymp_equiv_sandwich_real' asymp_equiv_trans) end diff -r 7d7786585ab0 -r 8f2e6186408f src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Sun Feb 05 20:09:39 2023 +0100 +++ b/src/HOL/Transcendental.thy Mon Feb 06 15:41:23 2023 +0000 @@ -2521,20 +2521,7 @@ lemma powr_real_of_int': assumes "x \ 0" "x \ 0 \ n > 0" shows "x powr real_of_int n = power_int x n" -proof (cases "x = 0") - case False - with assms have "x > 0" by simp - show ?thesis - proof (cases n rule: int_cases4) - case (nonneg n) - thus ?thesis using \x > 0\ - by (auto simp add: powr_realpow) - next - case (neg n) - thus ?thesis using \x > 0\ - by (auto simp add: powr_realpow powr_minus power_int_minus) - qed -qed (use assms in auto) + by (metis assms exp_ln_iff exp_power_int nless_le power_int_eq_0_iff powr_def) lemma log_ln: "ln x = log (exp(1)) x" by (simp add: log_def)