# HG changeset patch # User paulson # Date 1691831369 -3600 # Node ID 56a408fa2440bed602351f33e1b73a16d6f04eeb # Parent 1425a366fe7f42f43dd59251498f005561f58677 substantial tidy-up, shortening many proofs diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Affine.thy --- a/src/HOL/Analysis/Affine.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Affine.thy Sat Aug 12 10:09:29 2023 +0100 @@ -5,7 +5,7 @@ begin lemma if_smult: "(if P then x else (y::real)) *\<^sub>R v = (if P then x *\<^sub>R v else y *\<^sub>R v)" - by (fact if_distrib) + by simp lemma sum_delta_notmem: assumes "x \ s" @@ -13,12 +13,7 @@ and "sum (\y. if (x = y) then P x else Q y) s = sum Q s" and "sum (\y. if (y = x) then P y else Q y) s = sum Q s" and "sum (\y. if (x = y) then P y else Q y) s = sum Q s" - apply (rule_tac [!] sum.cong) - using assms - apply auto - done - -lemmas independent_finite = independent_imp_finite + by (smt (verit, best) assms sum.cong)+ lemma span_substd_basis: assumes d: "d \ Basis" @@ -32,13 +27,11 @@ ultimately have "span d \ ?B" using span_mono[of d "?B"] span_eq_iff[of "?B"] by blast moreover have *: "card d \ dim (span d)" - using independent_card_le_dim[of d "span d"] independent_substdbasis[OF assms] - span_superset[of d] - by auto + by (simp add: d dim_eq_card_independent independent_substdbasis) moreover from * have "dim ?B \ dim (span d)" using dim_substandard[OF assms] by auto ultimately show ?thesis - using s subspace_dim_equal[of "span d" "?B"] subspace_span[of d] by auto + by (simp add: s subspace_dim_equal) qed lemma basis_to_substdbasis_subspace_isomorphism: @@ -51,7 +44,8 @@ using dim_unique[of B B "card B"] assms span_superset[of B] by auto have "dim B \ card (Basis :: 'a set)" using dim_subset_UNIV[of B] by simp - from obtain_subset_with_card_n[OF this] obtain d :: "'a set" where d: "d \ Basis" and t: "card d = dim B" + from obtain_subset_with_card_n[OF this] + obtain d :: "'a set" where d: "d \ Basis" and t: "card d = dim B" by auto let ?t = "{x::'a::euclidean_space. \i\Basis. i \ d \ x\i = 0}" have "\f. linear f \ f ` B = d \ f ` span B = ?t \ inj_on f (span B)" @@ -65,9 +59,9 @@ subsection \Affine set and affine hull\ definition\<^marker>\tag important\ affine :: "'a::real_vector set \ bool" - where "affine s \ (\x\s. \y\s. \u v. u + v = 1 \ u *\<^sub>R x + v *\<^sub>R y \ s)" + where "affine S \ (\x\S. \y\S. \u v. u + v = 1 \ u *\<^sub>R x + v *\<^sub>R y \ S)" -lemma affine_alt: "affine s \ (\x\s. \y\s. \u::real. (1 - u) *\<^sub>R x + u *\<^sub>R y \ s)" +lemma affine_alt: "affine S \ (\x\S. \y\S. \u::real. (1 - u) *\<^sub>R x + u *\<^sub>R y \ S)" unfolding affine_def by (metis eq_diff_eq') lemma affine_empty [iff]: "affine {}" @@ -79,21 +73,21 @@ lemma affine_UNIV [iff]: "affine UNIV" unfolding affine_def by auto -lemma affine_Inter [intro]: "(\s. s\f \ affine s) \ affine (\f)" +lemma affine_Inter [intro]: "(\S. S\\ \ affine S) \ affine (\\)" unfolding affine_def by auto -lemma affine_Int[intro]: "affine s \ affine t \ affine (s \ t)" +lemma affine_Int[intro]: "affine S \ affine T \ affine (S \ T)" unfolding affine_def by auto -lemma affine_scaling: "affine s \ affine (image (\x. c *\<^sub>R x) s)" - apply (clarsimp simp add: affine_def) +lemma affine_scaling: "affine S \ affine ((*\<^sub>R) c ` S)" + apply (clarsimp simp: affine_def) apply (rule_tac x="u *\<^sub>R x + v *\<^sub>R y" in image_eqI) apply (auto simp: algebra_simps) done -lemma affine_affine_hull [simp]: "affine(affine hull s)" +lemma affine_affine_hull [simp]: "affine(affine hull S)" unfolding hull_def - using affine_Inter[of "{t. affine t \ s \ t}"] by auto + using affine_Inter[of "{T. affine T \ S \ T}"] by auto lemma affine_hull_eq[simp]: "(affine hull s = s) \ affine s" by (metis affine_affine_hull hull_same) @@ -198,6 +192,8 @@ "affine hull p = {y. \S u. finite S \ S \ {} \ S \ p \ sum u S = 1 \ sum (\v. u v *\<^sub>R v) S = y}" (is "_ = ?rhs") proof (rule hull_unique) + have "\x. sum (\z. 1) {x} = 1" + by auto show "p \ ?rhs" proof (intro subsetI CollectI exI conjI) show "\x. sum (\z. 1) {x} = 1" @@ -452,31 +448,16 @@ unfolding affine_parallel_def using image_add_0 by blast -lemma affine_parallel_commut: +lemma affine_parallel_commute: assumes "affine_parallel A B" shows "affine_parallel B A" -proof - - from assms obtain a where B: "B = (\x. a + x) ` A" - unfolding affine_parallel_def by auto - have [simp]: "(\x. x - a) = plus (- a)" by (simp add: fun_eq_iff) - from B show ?thesis - using translation_galois [of B a A] - unfolding affine_parallel_def by blast -qed + by (metis affine_parallel_def assms translation_galois) lemma affine_parallel_assoc: assumes "affine_parallel A B" and "affine_parallel B C" shows "affine_parallel A C" -proof - - from assms obtain ab where "B = (\x. ab + x) ` A" - unfolding affine_parallel_def by auto - moreover - from assms obtain bc where "C = (\x. bc + x) ` B" - unfolding affine_parallel_def by auto - ultimately show ?thesis - using translation_assoc[of bc ab A] unfolding affine_parallel_def by auto -qed + by (metis affine_parallel_def assms translation_assoc) lemma affine_translation_aux: fixes a :: "'a::real_vector" @@ -503,24 +484,13 @@ lemma affine_translation: "affine S \ affine ((+) a ` S)" for a :: "'a::real_vector" -proof - show "affine ((+) a ` S)" if "affine S" - using that translation_assoc [of "- a" a S] - by (auto intro: affine_translation_aux [of "- a" "((+) a ` S)"]) - show "affine S" if "affine ((+) a ` S)" - using that by (rule affine_translation_aux) -qed + by (metis affine_translation_aux translation_galois) lemma parallel_is_affine: fixes S T :: "'a::real_vector set" assumes "affine S" "affine_parallel S T" shows "affine T" -proof - - from assms obtain a where "T = (\x. a + x) ` S" - unfolding affine_parallel_def by auto - then show ?thesis - using affine_translation assms by auto -qed + by (metis affine_parallel_def affine_translation assms) lemma subspace_imp_affine: "subspace s \ affine s" unfolding subspace_def affine_def by auto @@ -532,64 +502,12 @@ subsubsection\<^marker>\tag unimportant\ \Subspace parallel to an affine set\ lemma subspace_affine: "subspace S \ affine S \ 0 \ S" -proof - - have h0: "subspace S \ affine S \ 0 \ S" - using subspace_imp_affine[of S] subspace_0 by auto - { - assume assm: "affine S \ 0 \ S" - { - fix c :: real - fix x - assume x: "x \ S" - have "c *\<^sub>R x = (1-c) *\<^sub>R 0 + c *\<^sub>R x" by auto - moreover - have "(1 - c) *\<^sub>R 0 + c *\<^sub>R x \ S" - using affine_alt[of S] assm x by auto - ultimately have "c *\<^sub>R x \ S" by auto - } - then have h1: "\c. \x \ S. c *\<^sub>R x \ S" by auto - - { - fix x y - assume xy: "x \ S" "y \ S" - define u where "u = (1 :: real)/2" - have "(1/2) *\<^sub>R (x+y) = (1/2) *\<^sub>R (x+y)" - by auto - moreover - have "(1/2) *\<^sub>R (x+y)=(1/2) *\<^sub>R x + (1-(1/2)) *\<^sub>R y" - by (simp add: algebra_simps) - moreover - have "(1 - u) *\<^sub>R x + u *\<^sub>R y \ S" - using affine_alt[of S] assm xy by auto - ultimately - have "(1/2) *\<^sub>R (x+y) \ S" - using u_def by auto - moreover - have "x + y = 2 *\<^sub>R ((1/2) *\<^sub>R (x+y))" - by auto - ultimately - have "x + y \ S" - using h1[rule_format, of "(1/2) *\<^sub>R (x+y)" "2"] by auto - } - then have "\x \ S. \y \ S. x + y \ S" - by auto - then have "subspace S" - using h1 assm unfolding subspace_def by auto - } - then show ?thesis using h0 by metis -qed + by (metis add_cancel_right_left affine_alt diff_add_cancel mem_affine_3 scaleR_eq_0_iff subspace_def vector_space_assms(4)) lemma affine_diffs_subspace: assumes "affine S" "a \ S" shows "subspace ((\x. (-a)+x) ` S)" -proof - - have [simp]: "(\x. x - a) = plus (- a)" by (simp add: fun_eq_iff) - have "affine ((\x. (-a)+x) ` S)" - using affine_translation assms by blast - moreover have "0 \ ((\x. (-a)+x) ` S)" - using assms exI[of "(\x. x\S \ -a+x = 0)" a] by auto - ultimately show ?thesis using subspace_affine by auto -qed + by (metis ab_left_minus affine_translation assms image_eqI subspace_affine) lemma affine_diffs_subspace_subtract: "subspace ((\x. x - a) ` S)" if "affine S" "a \ S" @@ -600,61 +518,26 @@ and "a \ S" assumes "L \ {y. \x \ S. (-a) + x = y}" shows "subspace L \ affine_parallel S L" -proof - - from assms have "L = plus (- a) ` S" by auto - then have par: "affine_parallel S L" - unfolding affine_parallel_def .. - then have "affine L" using assms parallel_is_affine by auto - moreover have "0 \ L" - using assms by auto - ultimately show ?thesis - using subspace_affine par by auto -qed + by (smt (verit) Collect_cong ab_left_minus affine_parallel_def assms image_def mem_Collect_eq parallel_is_affine subspace_affine) lemma parallel_subspace_aux: assumes "subspace A" and "subspace B" and "affine_parallel A B" shows "A \ B" -proof - - from assms obtain a where a: "\x. x \ A \ a + x \ B" - using affine_parallel_expl[of A B] by auto - then have "-a \ A" - using assms subspace_0[of B] by auto - then have "a \ A" - using assms subspace_neg[of A "-a"] by auto - then show ?thesis - using assms a unfolding subspace_def by auto -qed + by (metis add.right_neutral affine_parallel_expl assms subsetI subspace_def) lemma parallel_subspace: assumes "subspace A" and "subspace B" and "affine_parallel A B" shows "A = B" -proof - show "A \ B" - using assms parallel_subspace_aux by auto - show "A \ B" - using assms parallel_subspace_aux[of B A] affine_parallel_commut by auto -qed + by (simp add: affine_parallel_commute assms parallel_subspace_aux subset_antisym) lemma affine_parallel_subspace: assumes "affine S" "S \ {}" shows "\!L. subspace L \ affine_parallel S L" -proof - - have ex: "\L. subspace L \ affine_parallel S L" - using assms parallel_subspace_explicit by auto - { - fix L1 L2 - assume ass: "subspace L1 \ affine_parallel S L1" "subspace L2 \ affine_parallel S L2" - then have "affine_parallel L1 L2" - using affine_parallel_commut[of S L1] affine_parallel_assoc[of L1 S L2] by auto - then have "L1 = L2" - using ass parallel_subspace by auto - } - then show ?thesis using ex by auto -qed + by (meson affine_parallel_assoc affine_parallel_commute assms equals0I parallel_subspace parallel_subspace_explicit) subsection \Affine Dependence\ @@ -662,50 +545,49 @@ text "Formalized by Lars Schewe." definition\<^marker>\tag important\ affine_dependent :: "'a::real_vector set \ bool" - where "affine_dependent s \ (\x\s. x \ affine hull (s - {x}))" + where "affine_dependent S \ (\x\S. x \ affine hull (S - {x}))" -lemma affine_dependent_imp_dependent: "affine_dependent s \ dependent s" +lemma affine_dependent_imp_dependent: "affine_dependent S \ dependent S" unfolding affine_dependent_def dependent_def using affine_hull_subset_span by auto lemma affine_dependent_subset: - "\affine_dependent s; s \ t\ \ affine_dependent t" -apply (simp add: affine_dependent_def Bex_def) -apply (blast dest: hull_mono [OF Diff_mono [OF _ subset_refl]]) -done + "\affine_dependent S; S \ T\ \ affine_dependent T" + using hull_mono [OF Diff_mono [OF _ subset_refl]] + by (smt (verit) affine_dependent_def subsetD) lemma affine_independent_subset: - shows "\\ affine_dependent t; s \ t\ \ \ affine_dependent s" -by (metis affine_dependent_subset) + shows "\\ affine_dependent T; S \ T\ \ \ affine_dependent S" + by (metis affine_dependent_subset) lemma affine_independent_Diff: - "\ affine_dependent s \ \ affine_dependent(s - t)" + "\ affine_dependent S \ \ affine_dependent(S - T)" by (meson Diff_subset affine_dependent_subset) proposition affine_dependent_explicit: "affine_dependent p \ - (\S u. finite S \ S \ p \ sum u S = 0 \ (\v\S. u v \ 0) \ sum (\v. u v *\<^sub>R v) S = 0)" + (\S U. finite S \ S \ p \ sum U S = 0 \ (\v\S. U v \ 0) \ sum (\v. U v *\<^sub>R v) S = 0)" proof - - have "\S u. finite S \ S \ p \ sum u S = 0 \ (\v\S. u v \ 0) \ (\w\S. u w *\<^sub>R w) = 0" - if "(\w\S. u w *\<^sub>R w) = x" "x \ p" "finite S" "S \ {}" "S \ p - {x}" "sum u S = 1" for x S u + have "\S U. finite S \ S \ p \ sum U S = 0 \ (\v\S. U v \ 0) \ (\w\S. U w *\<^sub>R w) = 0" + if "(\w\S. U w *\<^sub>R w) = x" "x \ p" "finite S" "S \ {}" "S \ p - {x}" "sum U S = 1" for x S U proof (intro exI conjI) have "x \ S" using that by auto - then show "(\v \ insert x S. if v = x then - 1 else u v) = 0" + then show "(\v \ insert x S. if v = x then - 1 else U v) = 0" using that by (simp add: sum_delta_notmem) - show "(\w \ insert x S. (if w = x then - 1 else u w) *\<^sub>R w) = 0" + show "(\w \ insert x S. (if w = x then - 1 else U w) *\<^sub>R w) = 0" using that \x \ S\ by (simp add: if_smult sum_delta_notmem cong: if_cong) qed (use that in auto) - moreover have "\x\p. \S u. finite S \ S \ {} \ S \ p - {x} \ sum u S = 1 \ (\v\S. u v *\<^sub>R v) = x" - if "(\v\S. u v *\<^sub>R v) = 0" "finite S" "S \ p" "sum u S = 0" "v \ S" "u v \ 0" for S u v + moreover have "\x\p. \S U. finite S \ S \ {} \ S \ p - {x} \ sum U S = 1 \ (\v\S. U v *\<^sub>R v) = x" + if "(\v\S. U v *\<^sub>R v) = 0" "finite S" "S \ p" "sum U S = 0" "v \ S" "U v \ 0" for S U v proof (intro bexI exI conjI) have "S \ {v}" using that by auto then show "S - {v} \ {}" using that by auto - show "(\x \ S - {v}. - (1 / u v) * u x) = 1" + show "(\x \ S - {v}. - (1 / U v) * U x) = 1" unfolding sum_distrib_left[symmetric] sum_diff1[OF \finite S\] by (simp add: that) - show "(\x\S - {v}. (- (1 / u v) * u x) *\<^sub>R x) = v" + show "(\x\S - {v}. (- (1 / U v) * U x) *\<^sub>R x) = v" unfolding sum_distrib_left [symmetric] scaleR_scaleR[symmetric] scaleR_right.sum [symmetric] sum_diff1[OF \finite S\] using that by auto @@ -720,90 +602,82 @@ fixes S :: "'a::real_vector set" assumes "finite S" shows "affine_dependent S \ - (\u. sum u S = 0 \ (\v\S. u v \ 0) \ sum (\v. u v *\<^sub>R v) S = 0)" + (\U. sum U S = 0 \ (\v\S. U v \ 0) \ sum (\v. U v *\<^sub>R v) S = 0)" (is "?lhs = ?rhs") proof - have *: "\vt u v. (if vt then u v else 0) *\<^sub>R v = (if vt then (u v) *\<^sub>R v else 0::'a)" + have *: "\vt U v. (if vt then U v else 0) *\<^sub>R v = (if vt then (U v) *\<^sub>R v else 0::'a)" by auto assume ?lhs - then obtain t u v where - "finite t" "t \ S" "sum u t = 0" "v\t" "u v \ 0" "(\v\t. u v *\<^sub>R v) = 0" + then obtain T U v where + "finite T" "T \ S" "sum U T = 0" "v\T" "U v \ 0" "(\v\T. U v *\<^sub>R v) = 0" unfolding affine_dependent_explicit by auto then show ?rhs - apply (rule_tac x="\x. if x\t then u x else 0" in exI) - apply (auto simp: * sum.inter_restrict[OF assms, symmetric] Int_absorb1[OF \t\S\]) + apply (rule_tac x="\x. if x\T then U x else 0" in exI) + apply (auto simp: * sum.inter_restrict[OF assms, symmetric] Int_absorb1[OF \T\S\]) done next assume ?rhs - then obtain u v where "sum u S = 0" "v\S" "u v \ 0" "(\v\S. u v *\<^sub>R v) = 0" + then obtain U v where "sum U S = 0" "v\S" "U v \ 0" "(\v\S. U v *\<^sub>R v) = 0" by auto then show ?lhs unfolding affine_dependent_explicit using assms by auto qed lemma dependent_imp_affine_dependent: - assumes "dependent {x - a| x . x \ s}" - and "a \ s" - shows "affine_dependent (insert a s)" + assumes "dependent {x - a| x . x \ S}" + and "a \ S" + shows "affine_dependent (insert a S)" proof - - from assms(1)[unfolded dependent_explicit] obtain S u v - where obt: "finite S" "S \ {x - a |x. x \ s}" "v\S" "u v \ 0" "(\v\S. u v *\<^sub>R v) = 0" + from assms(1)[unfolded dependent_explicit] obtain S' U v + where S: "finite S'" "S' \ {x - a |x. x \ S}" "v\S'" "U v \ 0" "(\v\S'. U v *\<^sub>R v) = 0" by auto - define t where "t = (\x. x + a) ` S" - - have inj: "inj_on (\x. x + a) S" + define T where "T = (\x. x + a) ` S'" + have inj: "inj_on (\x. x + a) S'" unfolding inj_on_def by auto - have "0 \ S" - using obt(2) assms(2) unfolding subset_eq by auto - have fin: "finite t" and "t \ s" - unfolding t_def using obt(1,2) by auto - then have "finite (insert a t)" and "insert a t \ insert a s" + have "0 \ S'" + using S(2) assms(2) unfolding subset_eq by auto + have fin: "finite T" and "T \ S" + unfolding T_def using S(1,2) by auto + then have "finite (insert a T)" and "insert a T \ insert a S" by auto - moreover have *: "\P Q. (\x\t. (if x = a then P x else Q x)) = (\x\t. Q x)" - apply (rule sum.cong) - using \a\s\ \t\s\ - apply auto - done - have "(\x\insert a t. if x = a then - (\x\t. u (x - a)) else u (x - a)) = 0" - unfolding sum_clauses(2)[OF fin] * using \a\s\ \t\s\ by auto - moreover have "\v\insert a t. (if v = a then - (\x\t. u (x - a)) else u (v - a)) \ 0" - using obt(3,4) \0\S\ - by (rule_tac x="v + a" in bexI) (auto simp: t_def) - moreover have *: "\P Q. (\x\t. (if x = a then P x else Q x) *\<^sub>R x) = (\x\t. Q x *\<^sub>R x)" - using \a\s\ \t\s\ by (auto intro!: sum.cong) - have "(\x\t. u (x - a)) *\<^sub>R a = (\v\t. u (v - a) *\<^sub>R v)" + moreover have *: "\P Q. (\x\T. (if x = a then P x else Q x)) = (\x\T. Q x)" + by (smt (verit, best) \T \ S\ assms(2) subsetD sum.cong) + have "(\x\insert a T. if x = a then - (\x\T. U (x - a)) else U (x - a)) = 0" + by (smt (verit) \T \ S\ assms(2) fin insert_absorb insert_subset sum.insert sum_mono) + moreover have "\v\insert a T. (if v = a then - (\x\T. U (x - a)) else U (v - a)) \ 0" + using S(3,4) \0\S'\ + by (rule_tac x="v + a" in bexI) (auto simp: T_def) + moreover have *: "\P Q. (\x\T. (if x = a then P x else Q x) *\<^sub>R x) = (\x\T. Q x *\<^sub>R x)" + using \a\S\ \T\S\ by (auto intro!: sum.cong) + have "(\x\T. U (x - a)) *\<^sub>R a = (\v\T. U (v - a) *\<^sub>R v)" unfolding scaleR_left.sum - unfolding t_def and sum.reindex[OF inj] and o_def - using obt(5) + unfolding T_def and sum.reindex[OF inj] and o_def + using S(5) by (auto simp: sum.distrib scaleR_right_distrib) - then have "(\v\insert a t. (if v = a then - (\x\t. u (x - a)) else u (v - a)) *\<^sub>R v) = 0" - unfolding sum_clauses(2)[OF fin] - using \a\s\ \t\s\ - by (auto simp: *) + then have "(\v\insert a T. (if v = a then - (\x\T. U (x - a)) else U (v - a)) *\<^sub>R v) = 0" + unfolding sum_clauses(2)[OF fin] using \a\S\ \T\S\ by (auto simp: *) ultimately show ?thesis unfolding affine_dependent_explicit - apply (rule_tac x="insert a t" in exI, auto) - done + by (force intro!: exI[where x="insert a T"]) qed lemma affine_dependent_biggerset: - fixes s :: "'a::euclidean_space set" - assumes "finite s" "card s \ DIM('a) + 2" - shows "affine_dependent s" + fixes S :: "'a::euclidean_space set" + assumes "finite S" "card S \ DIM('a) + 2" + shows "affine_dependent S" proof - - have "s \ {}" using assms by auto - then obtain a where "a\s" by auto - have *: "{x - a |x. x \ s - {a}} = (\x. x - a) ` (s - {a})" + have "S \ {}" using assms by auto + then obtain a where "a\S" by auto + have *: "{x - a |x. x \ S - {a}} = (\x. x - a) ` (S - {a})" by auto - have "card {x - a |x. x \ s - {a}} = card (s - {a})" + have "card {x - a |x. x \ S - {a}} = card (S - {a})" unfolding * by (simp add: card_image inj_on_def) also have "\ > DIM('a)" using assms(2) - unfolding card_Diff_singleton[OF \a\s\] by auto - finally show ?thesis - apply (subst insert_Diff[OF \a\s\, symmetric]) - apply (rule dependent_imp_affine_dependent) - apply (rule dependent_biggerset, auto) - done + unfolding card_Diff_singleton[OF \a\S\] by auto + finally have "affine_dependent (insert a (S - {a}))" + using dependent_biggerset dependent_imp_affine_dependent by blast + then show ?thesis + by (simp add: \a \ S\ insert_absorb) qed lemma affine_dependent_biggerset_general: @@ -822,13 +696,10 @@ also have "\ < dim S + 1" by auto also have "\ \ card (S - {a})" using assms card_Diff_singleton[OF \a\S\] by auto - finally show ?thesis - apply (subst insert_Diff[OF \a\S\, symmetric]) - apply (rule dependent_imp_affine_dependent) - apply (rule dependent_biggerset_general) - unfolding ** - apply auto - done + finally have "affine_dependent (insert a (S - {a}))" + by (smt (verit) Collect_cong dependent_imp_affine_dependent dependent_biggerset_general ** Diff_iff insertCI) + then show ?thesis + by (simp add: \a \ S\ insert_absorb) qed @@ -882,16 +753,7 @@ lemma affine_dependent_translation_eq: "affine_dependent S \ affine_dependent ((\x. a + x) ` S)" -proof - - { - assume "affine_dependent ((\x. a + x) ` S)" - then have "affine_dependent S" - using affine_dependent_translation[of "((\x. a + x) ` S)" "-a"] translation_assoc[of "-a" a] - by auto - } - then show ?thesis - using affine_dependent_translation by auto -qed + by (metis affine_dependent_translation translation_galois) lemma affine_hull_0_dependent: assumes "0 \ affine hull S" @@ -919,14 +781,8 @@ ultimately have "x \ span (S - {x})" by auto then have "x \ 0 \ dependent S" using x dependent_def by auto - moreover - { - assume "x = 0" - then have "0 \ affine hull S" - using x hull_mono[of "S - {0}" S] by auto - then have "dependent S" - using affine_hull_0_dependent by auto - } + moreover have "dependent S" if "x = 0" + by (metis that affine_hull_0_dependent Diff_insert_absorb dependent_zero x) ultimately show ?thesis by auto qed @@ -945,60 +801,45 @@ lemma affine_dependent_iff_dependent2: assumes "a \ S" shows "affine_dependent S \ dependent ((\x. -a + x) ` (S-{a}))" -proof - - have "insert a (S - {a}) = S" - using assms by auto - then show ?thesis - using assms affine_dependent_iff_dependent[of a "S-{a}"] by auto -qed + by (metis Diff_iff affine_dependent_iff_dependent assms insert_Diff singletonI) lemma affine_hull_insert_span_gen: - "affine hull (insert a s) = (\x. a + x) ` span ((\x. - a + x) ` s)" + "affine hull (insert a S) = (\x. a + x) ` span ((\x. - a + x) ` S)" proof - - have h1: "{x - a |x. x \ s} = ((\x. -a+x) ` s)" + have h1: "{x - a |x. x \ S} = ((\x. -a+x) ` S)" by auto { - assume "a \ s" + assume "a \ S" then have ?thesis - using affine_hull_insert_span[of a s] h1 by auto + using affine_hull_insert_span[of a S] h1 by auto } moreover { - assume a1: "a \ s" - have "\x. x \ s \ -a+x=0" - apply (rule exI[of _ a]) - using a1 - apply auto - done - then have "insert 0 ((\x. -a+x) ` (s - {a})) = (\x. -a+x) ` s" + assume a1: "a \ S" + then have "insert 0 ((\x. -a+x) ` (S - {a})) = (\x. -a+x) ` S" by auto - then have "span ((\x. -a+x) ` (s - {a}))=span ((\x. -a+x) ` s)" - using span_insert_0[of "(+) (- a) ` (s - {a})"] by (auto simp del: uminus_add_conv_diff) - moreover have "{x - a |x. x \ (s - {a})} = ((\x. -a+x) ` (s - {a}))" + then have "span ((\x. -a+x) ` (S - {a})) = span ((\x. -a+x) ` S)" + using span_insert_0[of "(+) (- a) ` (S - {a})"] + by presburger + moreover have "{x - a |x. x \ (S - {a})} = ((\x. -a+x) ` (S - {a}))" by auto - moreover have "insert a (s - {a}) = insert a s" + moreover have "insert a (S - {a}) = insert a S" by auto ultimately have ?thesis - using affine_hull_insert_span[of "a" "s-{a}"] by auto + using affine_hull_insert_span[of "a" "S-{a}"] by auto } ultimately show ?thesis by auto qed lemma affine_hull_span2: - assumes "a \ s" - shows "affine hull s = (\x. a+x) ` span ((\x. -a+x) ` (s-{a}))" - using affine_hull_insert_span_gen[of a "s - {a}", unfolded insert_Diff[OF assms]] - by auto + assumes "a \ S" + shows "affine hull S = (\x. a+x) ` span ((\x. -a+x) ` (S-{a}))" + by (metis affine_hull_insert_span_gen assms insert_Diff) lemma affine_hull_span_gen: - assumes "a \ affine hull s" - shows "affine hull s = (\x. a+x) ` span ((\x. -a+x) ` s)" -proof - - have "affine hull (insert a s) = affine hull s" - using hull_redundant[of a affine s] assms by auto - then show ?thesis - using affine_hull_insert_span_gen[of a "s"] by auto -qed + assumes "a \ affine hull S" + shows "affine hull S = (\x. a+x) ` span ((\x. -a+x) ` S)" + by (metis affine_hull_insert_span_gen assms hull_redundant) lemma affine_hull_span_0: assumes "0 \ affine hull S" @@ -1044,29 +885,13 @@ lemma affine_basis_exists: fixes V :: "'n::real_vector set" shows "\B. B \ V \ \ affine_dependent B \ affine hull V = affine hull B" -proof (cases "V = {}") - case True - then show ?thesis - using affine_independent_0 by auto -next - case False - then obtain x where "x \ V" by auto - then show ?thesis - using affine_dependent_def[of "{x}"] extend_to_affine_basis_nonempty[of "{x}" V] - by auto -qed + by (metis affine_dependent_def affine_independent_1 empty_subsetI extend_to_affine_basis_nonempty insert_subset order_refl) proposition extend_to_affine_basis: fixes S V :: "'n::real_vector set" assumes "\ affine_dependent S" "S \ V" obtains T where "\ affine_dependent T" "S \ T" "T \ V" "affine hull T = affine hull V" -proof (cases "S = {}") - case True then show ?thesis - using affine_basis_exists by (metis empty_subsetI that) -next - case False - then show ?thesis by (metis assms extend_to_affine_basis_nonempty that) -qed + by (metis affine_basis_exists assms(1) assms(2) bot.extremum extend_to_affine_basis_nonempty) subsection \Affine Dimension of a Set\ @@ -1095,7 +920,7 @@ by (metis affine_empty subset_empty subset_hull) lemma empty_eq_affine_hull[simp]: "{} = affine hull S \ S = {}" -by (metis affine_hull_eq_empty) + by (metis affine_hull_eq_empty) lemma aff_dim_parallel_subspace_aux: fixes B :: "'n::euclidean_space set" @@ -1146,7 +971,7 @@ define Lb where "Lb = span ((\x. -a+x) ` (B-{a}))" moreover have "affine_parallel (affine hull B) Lb" using Lb_def B assms affine_hull_span2[of a B] a - affine_parallel_commut[of "Lb" "(affine hull B)"] + affine_parallel_commute[of "Lb" "(affine hull B)"] unfolding affine_parallel_def by auto moreover have "subspace Lb" @@ -1168,15 +993,7 @@ fixes B :: "'n::euclidean_space set" assumes "\ affine_dependent B" shows "finite B" -proof - - { - assume "B \ {}" - then obtain a where "a \ B" by auto - then have ?thesis - using aff_dim_parallel_subspace_aux assms by auto - } - then show ?thesis by auto -qed + using aff_dim_parallel_subspace_aux assms finite.simps by fastforce lemma aff_dim_empty: @@ -1195,7 +1012,7 @@ qed lemma aff_dim_empty_eq [simp]: "aff_dim ({}::'a::euclidean_space set) = -1" - by (simp add: aff_dim_empty [symmetric]) + using aff_dim_empty by blast lemma aff_dim_affine_hull [simp]: "aff_dim (affine hull S) = aff_dim S" unfolding aff_dim_def using hull_hull[of _ S] by auto @@ -1224,7 +1041,7 @@ define Lb where "Lb = span ((\x. -a+x) ` (B-{a}))" have "affine_parallel (affine hull B) Lb" using Lb_def affine_hull_span2[of a B] a - affine_parallel_commut[of "Lb" "(affine hull B)"] + affine_parallel_commute[of "Lb" "(affine hull B)"] unfolding affine_parallel_def by auto moreover have "subspace Lb" using Lb_def subspace_span by auto @@ -1245,11 +1062,14 @@ using aff_dim_unique[of B B] assms by auto lemma affine_independent_iff_card: - fixes s :: "'a::euclidean_space set" - shows "\ affine_dependent s \ finite s \ aff_dim s = int(card s) - 1" - apply (rule iffI) - apply (simp add: aff_dim_affine_independent aff_independent_finite) - by (metis affine_basis_exists [of s] aff_dim_unique card_subset_eq diff_add_cancel of_nat_eq_iff) + fixes S :: "'a::euclidean_space set" + shows "\ affine_dependent S \ finite S \ aff_dim S = int(card S) - 1" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + by (simp add: aff_dim_affine_independent aff_independent_finite) + show "?rhs \ ?lhs" + by (metis of_nat_eq_iff affine_basis_exists aff_dim_unique card_subset_eq diff_add_cancel) +qed lemma aff_dim_sing [simp]: fixes a :: "'n::euclidean_space" @@ -1272,78 +1092,39 @@ fixes V :: "('n::euclidean_space) set" shows "\B. B \ V \ affine hull B = affine hull V \ \ affine_dependent B \ of_nat (card B) = aff_dim V + 1" -proof - - obtain B where B: "\ affine_dependent B" "B \ V" "affine hull B = affine hull V" - using affine_basis_exists[of V] by auto - then have "of_nat(card B) = aff_dim V+1" using aff_dim_unique by auto - with B show ?thesis by auto -qed + by (metis aff_dim_unique affine_basis_exists) lemma aff_dim_le_card: fixes V :: "'n::euclidean_space set" assumes "finite V" shows "aff_dim V \ of_nat (card V) - 1" -proof - - obtain B where B: "B \ V" "of_nat (card B) = aff_dim V + 1" - using aff_dim_inner_basis_exists[of V] by auto - then have "card B \ card V" - using assms card_mono by auto - with B show ?thesis by auto + by (metis aff_dim_inner_basis_exists assms card_mono le_diff_eq of_nat_le_iff) + +lemma aff_dim_parallel_le: + fixes S T :: "'n::euclidean_space set" + assumes "affine_parallel (affine hull S) (affine hull T)" + shows "aff_dim S \ aff_dim T" +proof (cases "S={} \ T={}") + case True + then show ?thesis + by (smt (verit, best) aff_dim_affine_hull2 affine_hull_empty affine_parallel_def assms empty_is_image) +next + case False + then obtain L where L: "subspace L" "affine_parallel (affine hull T) L" + by (metis affine_affine_hull affine_hull_eq_empty affine_parallel_subspace) + with False show ?thesis + by (metis aff_dim_parallel_subspace affine_parallel_assoc assms dual_order.refl) qed lemma aff_dim_parallel_eq: fixes S T :: "'n::euclidean_space set" assumes "affine_parallel (affine hull S) (affine hull T)" shows "aff_dim S = aff_dim T" -proof - - { - assume "T \ {}" "S \ {}" - then obtain L where L: "subspace L \ affine_parallel (affine hull T) L" - using affine_parallel_subspace[of "affine hull T"] - affine_affine_hull[of T] - by auto - then have "aff_dim T = int (dim L)" - using aff_dim_parallel_subspace \T \ {}\ by auto - moreover have *: "subspace L \ affine_parallel (affine hull S) L" - using L affine_parallel_assoc[of "affine hull S" "affine hull T" L] assms by auto - moreover from * have "aff_dim S = int (dim L)" - using aff_dim_parallel_subspace \S \ {}\ by auto - ultimately have ?thesis by auto - } - moreover - { - assume "S = {}" - then have "S = {}" and "T = {}" - using assms - unfolding affine_parallel_def - by auto - then have ?thesis using aff_dim_empty by auto - } - moreover - { - assume "T = {}" - then have "S = {}" and "T = {}" - using assms - unfolding affine_parallel_def - by auto - then have ?thesis - using aff_dim_empty by auto - } - ultimately show ?thesis by blast -qed + by (smt (verit, del_insts) aff_dim_parallel_le affine_parallel_commute assms) lemma aff_dim_translation_eq: "aff_dim ((+) a ` S) = aff_dim S" for a :: "'n::euclidean_space" -proof - - have "affine_parallel (affine hull S) (affine hull ((\x. a + x) ` S))" - unfolding affine_parallel_def - apply (rule exI[of _ "a"]) - using affine_hull_translation[of a S] - apply auto - done - then show ?thesis - using aff_dim_parallel_eq[of S "(\x. a + x) ` S"] by auto -qed + by (metis aff_dim_parallel_eq affine_hull_translation affine_parallel_def) lemma aff_dim_translation_eq_subtract: "aff_dim ((\x. x - a) ` S) = aff_dim S" for a :: "'n::euclidean_space" @@ -1351,97 +1132,51 @@ lemma aff_dim_affine: fixes S L :: "'n::euclidean_space set" - assumes "S \ {}" - and "affine S" - and "subspace L" - and "affine_parallel S L" + assumes "affine S" "subspace L" "affine_parallel S L" "S \ {}" shows "aff_dim S = int (dim L)" -proof - - have *: "affine hull S = S" - using assms affine_hull_eq[of S] by auto - then have "affine_parallel (affine hull S) L" - using assms by (simp add: *) - then show ?thesis - using assms aff_dim_parallel_subspace[of S L] by blast -qed + by (simp add: aff_dim_parallel_subspace assms hull_same) -lemma dim_affine_hull: +lemma dim_affine_hull [simp]: fixes S :: "'n::euclidean_space set" shows "dim (affine hull S) = dim S" -proof - - have "dim (affine hull S) \ dim S" - using dim_subset by auto - moreover have "dim (span S) \ dim (affine hull S)" - using dim_subset affine_hull_subset_span by blast - moreover have "dim (span S) = dim S" - using dim_span by auto - ultimately show ?thesis by auto -qed + by (metis affine_hull_subset_span dim_eq_span dim_mono hull_subset span_eq_dim) lemma aff_dim_subspace: fixes S :: "'n::euclidean_space set" assumes "subspace S" shows "aff_dim S = int (dim S)" -proof (cases "S={}") - case True with assms show ?thesis - by (simp add: subspace_affine) -next - case False - with aff_dim_affine[of S S] assms subspace_imp_affine[of S] affine_parallel_reflex[of S] subspace_affine - show ?thesis by auto -qed + by (metis aff_dim_affine affine_parallel_subspace assms empty_iff parallel_subspace subspace_affine) lemma aff_dim_zero: fixes S :: "'n::euclidean_space set" assumes "0 \ affine hull S" shows "aff_dim S = int (dim S)" -proof - - have "subspace (affine hull S)" - using subspace_affine[of "affine hull S"] affine_affine_hull assms - by auto - then have "aff_dim (affine hull S) = int (dim (affine hull S))" - using assms aff_dim_subspace[of "affine hull S"] by auto - then show ?thesis - using aff_dim_affine_hull[of S] dim_affine_hull[of S] - by auto -qed + by (metis aff_dim_affine_hull aff_dim_subspace affine_hull_span_0 assms dim_span subspace_span) lemma aff_dim_eq_dim: - "aff_dim S = int (dim ((+) (- a) ` S))" if "a \ affine hull S" - for S :: "'n::euclidean_space set" -proof - - have "0 \ affine hull (+) (- a) ` S" - unfolding affine_hull_translation - using that by (simp add: ac_simps) - with aff_dim_zero show ?thesis - by (metis aff_dim_translation_eq) -qed + fixes S :: "'n::euclidean_space set" + assumes "a \ affine hull S" + shows "aff_dim S = int (dim ((+) (- a) ` S))" + by (metis ab_left_minus aff_dim_translation_eq aff_dim_zero affine_hull_translation image_eqI assms) lemma aff_dim_eq_dim_subtract: - "aff_dim S = int (dim ((\x. x - a) ` S))" if "a \ affine hull S" - for S :: "'n::euclidean_space set" - using aff_dim_eq_dim [of a] that by (simp cong: image_cong_simp) + fixes S :: "'n::euclidean_space set" + assumes "a \ affine hull S" + shows "aff_dim S = int (dim ((\x. x - a) ` S))" + using aff_dim_eq_dim assms by auto lemma aff_dim_UNIV [simp]: "aff_dim (UNIV :: 'n::euclidean_space set) = int(DIM('n))" - using aff_dim_subspace[of "(UNIV :: 'n::euclidean_space set)"] - dim_UNIV[where 'a="'n::euclidean_space"] - by auto + by (simp add: aff_dim_subspace) lemma aff_dim_geq: fixes V :: "'n::euclidean_space set" shows "aff_dim V \ -1" -proof - - obtain B where "affine hull B = affine hull V" - and "\ affine_dependent B" - and "int (card B) = aff_dim V + 1" - using aff_dim_basis_exists by auto - then show ?thesis by auto -qed + by (metis add_le_cancel_right aff_dim_basis_exists diff_self of_nat_0_le_iff uminus_add_conv_diff) lemma aff_dim_negative_iff [simp]: fixes S :: "'n::euclidean_space set" - shows "aff_dim S < 0 \S = {}" -by (metis aff_dim_empty aff_dim_geq diff_0 eq_iff zle_diff1_eq) + shows "aff_dim S < 0 \ S = {}" + by (metis aff_dim_empty aff_dim_geq diff_0 eq_iff zle_diff1_eq) lemma aff_lowdim_subset_hyperplane: fixes S :: "'a::euclidean_space set" @@ -1482,83 +1217,48 @@ fixes S :: "'a :: euclidean_space set" assumes "\ affine_dependent S" "a \ S" shows "card S = dim ((\x. x - a) ` S) + 1" -proof - - have non: "\ affine_dependent (insert a S)" - by (simp add: assms insert_absorb) - have "finite S" - by (meson assms aff_independent_finite) - with \a \ S\ have "card S \ 0" by auto - moreover have "dim ((\x. x - a) ` S) = card S - 1" - using aff_dim_eq_dim_subtract aff_dim_unique \a \ S\ hull_inc insert_absorb non by fastforce - ultimately show ?thesis - by auto -qed + using aff_dim_affine_independent aff_dim_eq_dim_subtract assms hull_subset by fastforce lemma independent_card_le_aff_dim: fixes B :: "'n::euclidean_space set" assumes "B \ V" assumes "\ affine_dependent B" shows "int (card B) \ aff_dim V + 1" -proof - - obtain T where T: "\ affine_dependent T \ B \ T \ T \ V \ affine hull T = affine hull V" - by (metis assms extend_to_affine_basis[of B V]) - then have "of_nat (card T) = aff_dim V + 1" - using aff_dim_unique by auto - then show ?thesis - using T card_mono[of T B] aff_independent_finite[of T] by auto -qed + by (metis aff_dim_unique aff_independent_finite assms card_mono extend_to_affine_basis of_nat_mono) lemma aff_dim_subset: fixes S T :: "'n::euclidean_space set" assumes "S \ T" shows "aff_dim S \ aff_dim T" -proof - - obtain B where B: "\ affine_dependent B" "B \ S" "affine hull B = affine hull S" - "of_nat (card B) = aff_dim S + 1" - using aff_dim_inner_basis_exists[of S] by auto - then have "int (card B) \ aff_dim T + 1" - using assms independent_card_le_aff_dim[of B T] by auto - with B show ?thesis by auto -qed + by (metis add_le_cancel_right aff_dim_inner_basis_exists assms dual_order.trans independent_card_le_aff_dim) lemma aff_dim_le_DIM: fixes S :: "'n::euclidean_space set" shows "aff_dim S \ int (DIM('n))" -proof - - have "aff_dim (UNIV :: 'n::euclidean_space set) = int(DIM('n))" - using aff_dim_UNIV by auto - then show "aff_dim (S:: 'n::euclidean_space set) \ int(DIM('n))" - using aff_dim_subset[of S "(UNIV :: ('n::euclidean_space) set)"] subset_UNIV by auto -qed + by (metis aff_dim_UNIV aff_dim_subset top_greatest) lemma affine_dim_equal: fixes S :: "'n::euclidean_space set" assumes "affine S" "affine T" "S \ {}" "S \ T" "aff_dim S = aff_dim T" shows "S = T" proof - - obtain a where "a \ S" using assms by auto - then have "a \ T" using assms by auto + obtain a where "a \ S" "a \ T" "T \ {}" using assms by auto define LS where "LS = {y. \x \ S. (-a) + x = y}" then have ls: "subspace LS" "affine_parallel S LS" using assms parallel_subspace_explicit[of S a LS] \a \ S\ by auto then have h1: "int(dim LS) = aff_dim S" using assms aff_dim_affine[of S LS] by auto - have "T \ {}" using assms by auto define LT where "LT = {y. \x \ T. (-a) + x = y}" then have lt: "subspace LT \ affine_parallel T LT" using assms parallel_subspace_explicit[of T a LT] \a \ T\ by auto - then have "int(dim LT) = aff_dim T" - using assms aff_dim_affine[of T LT] \T \ {}\ by auto then have "dim LS = dim LT" - using h1 assms by auto + using assms aff_dim_affine[of T LT] \T \ {}\ h1 by auto moreover have "LS \ LT" using LS_def LT_def assms by auto ultimately have "LS = LT" using subspace_dim_equal[of LS LT] ls lt by auto - moreover have "S = {x. \y \ LS. a+y=x}" - using LS_def by auto - moreover have "T = {x. \y \ LT. a+y=x}" - using LT_def by auto + moreover have "S = {x. \y \ LS. a+y=x}" "T = {x. \y \ LT. a+y=x}" + using LS_def LT_def by auto ultimately show ?thesis by auto qed @@ -1566,10 +1266,6 @@ fixes S :: "'a::euclidean_space set" shows "aff_dim S = 0 \ (\a. S = {a})" proof (cases "S = {}") - case True - then show ?thesis - by auto -next case False then obtain a where "a \ S" by auto show ?thesis @@ -1580,58 +1276,39 @@ then show "\a. S = {a}" using \a \ S\ by blast qed auto -qed +qed auto lemma affine_hull_UNIV: fixes S :: "'n::euclidean_space set" assumes "aff_dim S = int(DIM('n))" shows "affine hull S = (UNIV :: ('n::euclidean_space) set)" -proof - - have "S \ {}" - using assms aff_dim_empty[of S] by auto - have h0: "S \ affine hull S" - using hull_subset[of S _] by auto - have h1: "aff_dim (UNIV :: ('n::euclidean_space) set) = aff_dim S" - using aff_dim_UNIV assms by auto - then have h2: "aff_dim (affine hull S) \ aff_dim (UNIV :: ('n::euclidean_space) set)" - using aff_dim_le_DIM[of "affine hull S"] assms h0 by auto - have h3: "aff_dim S \ aff_dim (affine hull S)" - using h0 aff_dim_subset[of S "affine hull S"] assms by auto - then have h4: "aff_dim (affine hull S) = aff_dim (UNIV :: ('n::euclidean_space) set)" - using h0 h1 h2 by auto - then show ?thesis - using affine_dim_equal[of "affine hull S" "(UNIV :: ('n::euclidean_space) set)"] - affine_affine_hull[of S] affine_UNIV assms h4 h0 \S \ {}\ - by auto -qed + by (simp add: aff_dim_empty affine_dim_equal assms) lemma disjoint_affine_hull: - fixes s :: "'n::euclidean_space set" - assumes "\ affine_dependent s" "t \ s" "u \ s" "t \ u = {}" - shows "(affine hull t) \ (affine hull u) = {}" + fixes S :: "'n::euclidean_space set" + assumes "\ affine_dependent S" "T \ S" "U \ S" "T \ U = {}" + shows "(affine hull T) \ (affine hull U) = {}" proof - - from assms(1) have "finite s" - by (simp add: aff_independent_finite) - with assms(2,3) have "finite t" "finite u" - by (blast intro: finite_subset)+ - have False if "y \ affine hull t" and "y \ affine hull u" for y + obtain "finite S" "finite T" "finite U" + using assms by (simp add: aff_independent_finite finite_subset) + have False if "y \ affine hull T" and "y \ affine hull U" for y proof - from that obtain a b - where a1 [simp]: "sum a t = 1" - and [simp]: "sum (\v. a v *\<^sub>R v) t = y" - and [simp]: "sum b u = 1" "sum (\v. b v *\<^sub>R v) u = y" - by (auto simp: affine_hull_finite \finite t\ \finite u\) - define c where "c x = (if x \ t then a x else if x \ u then -(b x) else 0)" for x - from assms(2,3,4) have [simp]: "s \ t = t" "s \ - t \ u = u" - by auto - have "sum c s = 0" - by (simp add: c_def comm_monoid_add_class.sum.If_cases \finite s\ sum_negf) - moreover have "\ (\v\s. c v = 0)" - by (metis (no_types) IntD1 \s \ t = t\ a1 c_def sum.neutral zero_neq_one) - moreover have "(\v\s. c v *\<^sub>R v) = 0" - by (simp add: c_def if_smult sum_negf comm_monoid_add_class.sum.If_cases \finite s\) + where a1 [simp]: "sum a T = 1" + and [simp]: "sum (\v. a v *\<^sub>R v) T = y" + and [simp]: "sum b U = 1" "sum (\v. b v *\<^sub>R v) U = y" + by (auto simp: affine_hull_finite \finite T\ \finite U\) + define c where "c x = (if x \ T then a x else if x \ U then -(b x) else 0)" for x + have [simp]: "S \ T = T" "S \ - T \ U = U" + using assms by auto + have "sum c S = 0" + by (simp add: c_def comm_monoid_add_class.sum.If_cases \finite S\ sum_negf) + moreover have "\ (\v\S. c v = 0)" + by (metis (no_types) IntD1 \S \ T = T\ a1 c_def sum.neutral zero_neq_one) + moreover have "(\v\S. c v *\<^sub>R v) = 0" + by (simp add: c_def if_smult sum_negf comm_monoid_add_class.sum.If_cases \finite S\) ultimately show ?thesis - using assms(1) \finite s\ by (auto simp: affine_dependent_explicit) + using assms(1) \finite S\ by (auto simp: affine_dependent_explicit) qed then show ?thesis by blast qed diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Borel_Space.thy --- a/src/HOL/Analysis/Borel_Space.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Borel_Space.thy Sat Aug 12 10:09:29 2023 +0100 @@ -77,13 +77,7 @@ using of_rat_dense by blast assume * [rule_format]: "\d>0. \x\A. x \ a \ dist x a < d \ \ l < f x" from q2 have "real_of_rat q2 < f a \ (\x\A. x < a \ f x < real_of_rat q2)" - proof auto - fix x assume "x \ A" "x < a" - with q2 *[of "a - x"] show "f x < real_of_rat q2" - apply (auto simp add: dist_real_def not_less) - apply (subgoal_tac "f x \ f xa") - by (auto intro: mono) - qed + using q2 *[of "a - _"] dist_real_def mono by fastforce thus ?thesis by auto next fix u assume "u > f a" @@ -91,13 +85,7 @@ using of_rat_dense by blast assume *[rule_format]: "\d>0. \x\A. x \ a \ dist x a < d \ \ u > f x" from q2 have "real_of_rat q2 > f a \ (\x\A. x > a \ f x > real_of_rat q2)" - proof auto - fix x assume "x \ A" "x > a" - with q2 *[of "x - a"] show "f x > real_of_rat q2" - apply (auto simp add: dist_real_def) - apply (subgoal_tac "f x \ f xa") - by (auto intro: mono) - qed + using q2 *[of "_ - a"] dist_real_def mono by fastforce thus ?thesis by auto qed qed @@ -127,13 +115,8 @@ fixes A :: "real set" assumes "open A" "mono_on A f" shows "countable {a\A. \isCont f a}" -proof - - have "{a\A. \isCont f a} = {a\A. \(continuous (at a within A) f)}" - by (auto simp add: continuous_within_open [OF _ \open A\]) - thus ?thesis - apply (elim ssubst) - by (rule mono_on_ctble_discont, rule assms) -qed + using continuous_within_open [OF _ \open A\] \mono_on A f\ + by (smt (verit, ccfv_threshold) Collect_cong mono_on_ctble_discont) lemma mono_ctble_discont: fixes f :: "real \ real" @@ -144,8 +127,7 @@ lemma has_real_derivative_imp_continuous_on: assumes "\x. x \ A \ (f has_real_derivative f' x) (at x)" shows "continuous_on A f" - apply (intro differentiable_imp_continuous_on, unfold differentiable_on_def) - using assms differentiable_at_withinI real_differentiable_def by blast + by (meson DERIV_isCont assms continuous_at_imp_continuous_on) lemma continuous_interval_vimage_Int: assumes "continuous_on {a::real..b} g" and mono: "\x y. a \ x \ x \ y \ y \ b \ g x \ g y" @@ -173,14 +155,11 @@ intro!: mono) moreover have "c' \ d'" using c'd'_in_set(2) unfolding c'_def by (intro cInf_lower) auto moreover have "g c' \ c" "g d' \ d" - apply (insert c'' d'' c'd'_in_set) - apply (subst c''(2)[symmetric]) - apply (auto simp: c'_def intro!: mono cInf_lower c'') [] - apply (subst d''(2)[symmetric]) - apply (auto simp: d'_def intro!: mono cSup_upper d'') [] - done - with c'd'_in_set have "g c' = c" "g d' = d" by auto - ultimately show ?thesis using that by blast + using c'' d'' calculation by (metis IntE atLeastAtMost_iff mono order_class.order_eq_iff)+ + with c'd'_in_set have "g c' = c" "g d' = d" + by auto + ultimately show ?thesis + using that by blast qed subsection \Generic Borel spaces\ @@ -196,9 +175,7 @@ by (auto simp add: measurable_def borel_def) lemma in_borel_measurable_borel: - "f \ borel_measurable M \ - (\S \ sets borel. - f -` S \ space M \ sets M)" + "f \ borel_measurable M \ (\S \ sets borel. f -` S \ space M \ sets M)" by (auto simp add: measurable_def borel_def) lemma space_borel[simp]: "space borel = UNIV" @@ -219,10 +196,7 @@ lemma borel_open[measurable (raw generic)]: assumes "open A" shows "A \ sets borel" -proof - - have "A \ {S. open S}" unfolding mem_Collect_eq using assms . - thus ?thesis unfolding borel_def by auto -qed + by (simp add: assms sets_borel) lemma borel_closed[measurable (raw generic)]: assumes "closed A" shows "A \ sets borel" @@ -237,12 +211,7 @@ unfolding insert_def by (rule sets.Un) auto lemma sets_borel_eq_count_space: "sets (borel :: 'a::{countable, t2_space} measure) = count_space UNIV" -proof - - have "(\a\A. {a}) \ sets borel" for A :: "'a set" - by (intro sets.countable_UN') auto - then show ?thesis - by auto -qed + by (simp add: set_eq_iff sets.countable) lemma borel_comp[measurable]: "A \ sets borel \ - A \ sets borel" unfolding Compl_eq_Diff_UNIV by simp @@ -312,7 +281,7 @@ shows "f \ borel_measurable (restrict_space M \) \ (\x. f x * indicator \ x) \ borel_measurable M" by (subst measurable_restrict_space_iff) - (auto simp: indicator_def of_bool_def if_distrib[where f="\x. a * x" for a] cong del: if_weak_cong) + (auto simp: indicator_def of_bool_def if_distrib[where f="\x. a * x" for a] cong: if_cong) lemma borel_measurable_restrict_space_iff_ennreal: fixes f :: "'a \ ennreal" @@ -320,7 +289,7 @@ shows "f \ borel_measurable (restrict_space M \) \ (\x. f x * indicator \ x) \ borel_measurable M" by (subst measurable_restrict_space_iff) - (auto simp: indicator_def of_bool_def if_distrib[where f="\x. a * x" for a] cong del: if_weak_cong) + (auto simp: indicator_def of_bool_def if_distrib[where f="\x. a * x" for a] cong: if_cong) lemma borel_measurable_restrict_space_iff: fixes f :: "'a \ 'b::real_normed_vector" @@ -329,7 +298,7 @@ (\x. indicator \ x *\<^sub>R f x) \ borel_measurable M" by (subst measurable_restrict_space_iff) (auto simp: indicator_def of_bool_def if_distrib[where f="\x. x *\<^sub>R a" for a] ac_simps - cong del: if_weak_cong) + cong: if_cong) lemma cbox_borel[measurable]: "cbox a b \ sets borel" by (auto intro: borel_closed) @@ -338,7 +307,7 @@ by (auto intro: borel_open) lemma borel_compact: "compact (A::'a::t2_space set) \ A \ sets borel" - by (auto intro: borel_closed dest!: compact_imp_closed) + by (simp add: borel_closed compact_imp_closed) lemma borel_sigma_sets_subset: "A \ sets borel \ sigma_sets UNIV A \ sets borel" @@ -360,7 +329,7 @@ using X by (intro sigma_algebra.sigma_sets_subset[OF sigma_algebra_sigma_sets]) auto finally show "sigma_sets UNIV {S. open S} \ sigma_sets UNIV (F`A)" . show "sigma_sets UNIV (F`A) \ sigma_sets UNIV {S. open S}" - unfolding borel_rev_eq using F by (intro borel_sigma_sets_subset) auto + by (metis F image_subset_iff sets_borel sigma_sets_mono) qed auto lemma borel_eq_sigmaI2: @@ -371,7 +340,7 @@ assumes F: "\i j. (i, j) \ A \ F i j \ sets borel" shows "borel = sigma UNIV ((\(i, j). F i j) ` A)" using assms - by (intro borel_eq_sigmaI1[where X="(\(i, j). G i j) ` B" and F="(\(i, j). F i j)"]) auto + by (smt (verit, del_insts) borel_eq_sigmaI1 image_iff prod.collapse split_beta) lemma borel_eq_sigmaI3: fixes F :: "'i \ 'j \ 'a::topological_space set" and X :: "'a::topological_space set set" @@ -443,20 +412,15 @@ qed (auto simp: eq intro: generate_topology.Basis) lemma borel_eq_closed: "borel = sigma UNIV (Collect closed)" - unfolding borel_def -proof (intro sigma_eqI sigma_sets_eqI, safe) - fix x :: "'a set" assume "open x" - hence "x = UNIV - (UNIV - x)" by auto - also have "\ \ sigma_sets UNIV (Collect closed)" - by (force intro: sigma_sets.Compl simp: \open x\) - finally show "x \ sigma_sets UNIV (Collect closed)" by simp -next - fix x :: "'a set" assume "closed x" - hence "x = UNIV - (UNIV - x)" by auto - also have "\ \ sigma_sets UNIV (Collect open)" - by (force intro: sigma_sets.Compl simp: \closed x\) - finally show "x \ sigma_sets UNIV (Collect open)" by simp -qed simp_all +proof - + have "x \ sigma_sets UNIV (Collect closed)" + if "open x" for x :: "'a set" + by (metis that Compl_eq_Diff_UNIV closed_Compl double_complement mem_Collect_eq + sigma_sets.Basic sigma_sets.Compl) + then show ?thesis + unfolding borel_def + by (metis Pow_UNIV borel_closed mem_Collect_eq sets_borel sigma_eqI sigma_sets_eqI top_greatest) +qed proposition borel_eq_countable_basis: fixes B::"'a::topological_space set set" @@ -517,8 +481,7 @@ lemma borel_measurable_continuous_on_indicator: fixes f g :: "'a::topological_space \ 'b::real_normed_vector" shows "A \ sets borel \ continuous_on A f \ (\x. indicator A x *\<^sub>R f x) \ borel_measurable borel" - by (subst borel_measurable_restrict_space_iff[symmetric]) - (auto intro: borel_measurable_continuous_on_restrict) + using borel_measurable_continuous_on_restrict borel_measurable_restrict_space_iff inf_top.right_neutral by blast lemma borel_measurable_Pair[measurable (raw)]: fixes f :: "'a \ 'b::second_countable_topology" and g :: "'a \ 'c::second_countable_topology" @@ -720,7 +683,7 @@ shows "(\x. SUP i\I. F i x) \ borel_measurable M" proof cases assume "I = {}" then show ?thesis - unfolding \I = {}\ image_empty by simp + by (simp add: borel_measurable_const) next assume "I \ {}" show ?thesis @@ -742,7 +705,7 @@ shows "(\x. INF i\I. F i x) \ borel_measurable M" proof cases assume "I = {}" then show ?thesis - unfolding \I = {}\ image_empty by simp + by (simp add: borel_measurable_const) next assume "I \ {}" show ?thesis @@ -1045,25 +1008,23 @@ proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_le]) fix a :: real and i :: 'a assume "(a, i) \ UNIV \ Basis" then have i: "i \ Basis" by auto - have "{x::'a. x\i \ a} = UNIV - {x::'a. a < x\i}" by auto - also have *: "{x::'a. a < x\i} = - (\k::nat. {x. (\n\Basis. (if n = i then a else -real k) *\<^sub>R n) y. \j\Basis. j \ i \ - real y < x \ j" if "a < x \ i" for x + proof - obtain k where k: "Max ((\) (- x) ` Basis) < real k" using reals_Archimedean2 by blast { fix i :: 'a assume "i \ Basis" then have "-x\i < real k" using k by (subst (asm) Max_less_iff) auto then have "- real k < x\i" by simp } - then show "\k::nat. \ia\Basis. ia \ i \ -real k < x \ ia" + then show ?thesis by (auto intro!: exI[of _ k]) qed - finally show "{x. x\i \ a} \ ?SIGMA" - apply (simp only:) - apply (intro sets.countable_UN sets.Diff) - apply (auto intro: sigma_sets_top) - done + have "{x::'a. x\i \ a} = UNIV - {x::'a. a < x\i}" by auto + also have *: "{x::'a. a < x\i} = (\k::nat. {x. (\n\Basis. (if n = i then a else -k) *\<^sub>R n) i \ a} = UNIV - (\x. {xa. (\n\Basis. (if n = i then a else - real x) *\<^sub>R n) i \ a} \ ?SIGMA" + unfolding eq by (fastforce intro!: sigma_sets_top sets.Diff) qed auto lemma borel_eq_lessThan: @@ -1072,24 +1033,26 @@ proof (rule borel_eq_sigmaI4[OF borel_eq_halfspace_ge]) fix a :: real and i :: 'a assume "(a, i) \ UNIV \ Basis" then have i: "i \ Basis" by auto - have "{x::'a. a \ x\i} = UNIV - {x::'a. x\i < a}" by auto - also have *: "{x::'a. x\i < a} = (\k::nat. {x. x n\Basis. (if n = i then a else real k) *\<^sub>R n)})" using \i\ Basis\ - proof (safe, simp_all add: eucl_less_def split: if_split_asm) - fix x :: 'a + have **: "\y. \j\Basis. j \ i \ real y > x \ j" if "a > x \ i" for x + proof - obtain k where k: "Max ((\) x ` Basis) < real k" using reals_Archimedean2 by blast { fix i :: 'a assume "i \ Basis" then have "x\i < real k" using k by (subst (asm) Max_less_iff) auto then have "x\i < real k" by simp } - then show "\k::nat. \ia\Basis. ia \ i \ x \ ia < real k" + then show ?thesis by (auto intro!: exI[of _ k]) qed - finally show "{x. a \ x\i} \ ?SIGMA" - apply (simp only:) - apply (intro sets.countable_UN sets.Diff) - apply (auto intro: sigma_sets_top ) - done + have "{x::'a. a \ x\i} = UNIV - {x::'a. x\i < a}" by auto + also have *: "{x::'a. x\i < a} = (\k::nat. {x. x n\Basis. (if n = i then a else real k) *\<^sub>R n)})" using \i\ Basis\ + using i ** by (force simp add: eucl_less_def split: if_split_asm) + finally + have eq: "{x. a \ x \ i} = + UNIV - (\k. {x. x n\Basis. (if n = i then a else real k) *\<^sub>R n)})" . + + show "{x. a \ x\i} \ ?SIGMA" + unfolding eq by (fastforce intro!: sigma_sets_top sets.Diff) qed auto lemma borel_eq_atLeastAtMost: @@ -1276,9 +1239,7 @@ lemma borel_measurable_uminus_eq [simp]: fixes f :: "'a \ 'b::{second_countable_topology, real_normed_vector}" shows "(\x. - f x) \ borel_measurable M \ f \ borel_measurable M" (is "?l = ?r") -proof - assume ?l from borel_measurable_uminus[OF this] show ?r by simp -qed auto + by (smt (verit, ccfv_SIG) borel_measurable_uminus equation_minus_iff measurable_cong) lemma affine_borel_measurable_vector: fixes f :: "'a \ 'x::real_normed_vector" @@ -1294,8 +1255,10 @@ by (auto simp: algebra_simps) hence "?S \ sets borel" by auto moreover - from \b \ 0\ have "(\x. a + b *\<^sub>R f x) -` S = f -` ?S" - apply auto by (rule_tac x="a + b *\<^sub>R f x" in image_eqI, simp_all) + have "\x. \a + b *\<^sub>R f x \ S\ \ f x \ (\x. (x - a) /\<^sub>R b) ` S" + using \b \ 0\ image_iff by fastforce + with \b \ 0\ have "(\x. a + b *\<^sub>R f x) -` S = f -` ?S" + by auto ultimately show ?thesis using assms unfolding in_borel_measurable_borel by auto qed simp @@ -1313,10 +1276,12 @@ fixes f :: "'a \ 'b::real_normed_div_algebra" assumes f: "f \ borel_measurable M" shows "(\x. inverse (f x)) \ borel_measurable M" - apply (rule measurable_compose[OF f]) - apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"]) - apply (auto intro!: continuous_on_inverse continuous_on_id) - done +proof - + have "countable {0::'b}" "continuous_on (- {0::'b}) inverse" + by (auto intro!: continuous_on_inverse continuous_on_id) + then show ?thesis + by (metis borel_measurable_continuous_countable_exceptions f measurable_compose) +qed lemma borel_measurable_divide[measurable (raw)]: "f \ borel_measurable M \ g \ borel_measurable M \ @@ -1341,10 +1306,8 @@ lemma borel_measurable_ln[measurable (raw)]: assumes f: "f \ borel_measurable M" shows "(\x. ln (f x :: real)) \ borel_measurable M" - apply (rule measurable_compose[OF f]) - apply (rule borel_measurable_continuous_countable_exceptions[of "{0}"]) - apply (auto intro!: continuous_on_ln continuous_on_id) - done + using borel_measurable_continuous_countable_exceptions[of "{0}"] measurable_compose[OF f] + by (auto intro!: continuous_on_ln continuous_on_id) lemma borel_measurable_log[measurable (raw)]: "f \ borel_measurable M \ g \ borel_measurable M \ (\x. log (g x) (f x)) \ borel_measurable M" @@ -1402,12 +1365,16 @@ lemma\<^marker>\tag important\ borel_measurable_complex_iff: "f \ borel_measurable M \ - (\x. Re (f x)) \ borel_measurable M \ (\x. Im (f x)) \ borel_measurable M" - apply auto - apply (subst fun_complex_eq) - apply (intro borel_measurable_add) - apply auto - done + (\x. Re (f x)) \ borel_measurable M \ (\x. Im (f x)) \ borel_measurable M" (is "?lhs \ ?rhs") +proof + show "?lhs \ ?rhs" + using borel_measurable_Im borel_measurable_Re measurable_compose by blast + assume R: ?rhs + then have "(\x. complex_of_real (Re (f x)) + \ * complex_of_real (Im (f x))) \ borel_measurable M" + by (intro borel_measurable_add) auto + then show ?lhs + using complex_eq by force +qed lemma powr_real_measurable [measurable]: assumes "f \ measurable M borel" "g \ measurable M borel" @@ -1427,10 +1394,8 @@ fixes f :: "'a \ ereal" assumes f: "f \ borel_measurable M" shows "(\x. real_of_ereal (f x)) \ borel_measurable M" - apply (rule measurable_compose[OF f]) - apply (rule borel_measurable_continuous_countable_exceptions[of "{\, -\ }"]) - apply (auto intro: continuous_on_real simp: Compl_eq_Diff_UNIV) - done + using measurable_compose[OF f] borel_measurable_continuous_countable_exceptions[of "{\, -\ }"] + by (auto intro: continuous_on_real simp: Compl_eq_Diff_UNIV) lemma borel_measurable_ereal_cases: fixes f :: "'a \ ereal" @@ -1451,10 +1416,8 @@ by (auto simp del: abs_real_of_ereal simp: borel_measurable_ereal_cases[OF f] measurable_If) lemma borel_measurable_uminus_eq_ereal[simp]: - "(\x. - f x :: ereal) \ borel_measurable M \ f \ borel_measurable M" (is "?l = ?r") -proof - assume ?l from borel_measurable_uminus_ereal[OF this] show ?r by simp -qed auto + "(\x. - f x :: ereal) \ borel_measurable M \ f \ borel_measurable M" + by (smt (verit, ccfv_SIG) borel_measurable_uminus_ereal ereal_uminus_uminus measurable_cong) lemma set_Collect_ereal2: fixes f g :: "'a \ ereal" @@ -1511,13 +1474,7 @@ lemma vimage_sets_compl_iff: "f -` A \ space M \ sets M \ f -` (- A) \ space M \ sets M" -proof - - { fix A assume "f -` A \ space M \ sets M" - moreover have "f -` (- A) \ space M = space M - f -` A \ space M" by auto - ultimately have "f -` (- A) \ space M \ sets M" by auto } - from this[of A] this[of "-A"] show ?thesis - by (metis double_complement) -qed + by (metis Diff_Compl Diff_Diff_Int diff_eq inf_aci(1) sets.Diff sets.top vimage_Compl) lemma borel_measurable_iff_Iic_ereal: "(f::'a\ereal) \ borel_measurable M \ (\a. f -` {..a} \ space M \ sets M)" @@ -1741,7 +1698,7 @@ lemma Collect_closed_imp_pred_borel: "closed {x. P x} \ Measurable.pred borel P" by (simp add: pred_def) -(* Proof by Jeremy Avigad and Luke Serafin *) +text \Proof by Jeremy Avigad and Luke Serafin\ lemma isCont_borel_pred[measurable]: fixes f :: "'b::metric_space \ 'a::metric_space" shows "Measurable.pred borel (isCont f)" @@ -1821,12 +1778,19 @@ fixes f :: "real \ real" and A :: "real set" assumes "mono_on A f" shows "f \ borel_measurable (restrict_space borel A)" - apply (rule measurable_restrict_countable[OF mono_on_ctble_discont[OF assms]]) - apply (auto intro!: image_eqI[where x="{x}" for x] simp: sets_restrict_space) - apply (auto simp add: sets_restrict_restrict_space continuous_on_eq_continuous_within - cong: measurable_cong_sets - intro!: borel_measurable_continuous_on_restrict intro: continuous_within_subset) - done +proof - + have "\x. x \ A \ {x} \ sets (restrict_space borel A)" + using sets_restrict_space by fastforce + moreover + have "continuous_on (A \ - {a \ A. \ continuous (at a within A) f}) f" + by (force simp: continuous_on_eq_continuous_within intro: continuous_within_subset) + then have "f \ borel_measurable (restrict_space (restrict_space borel A) + (- {a \ A. \ continuous (at a within A) f}))" + by (smt (verit, best) borel_measurable_continuous_on_restrict measurable_cong_sets sets_restrict_restrict_space) + ultimately show ?thesis + using measurable_restrict_countable[OF mono_on_ctble_discont[OF assms]] + by (smt (verit, del_insts) UNIV_I mem_Collect_eq space_borel) +qed lemma borel_measurable_piecewise_mono: fixes f::"real \ real" and C::"real set set" @@ -1920,7 +1884,6 @@ fixes f g::"_\ 'a::{second_countable_topology, t2_space}" assumes [measurable]: "f \ borel_measurable M" "g \ borel_measurable M" shows "{x \ space M. f x = g x} \ sets M" - proof - define A where "A = {x \ space M. f x = g x}" define B where "B = {y. \x::'a. y = (x,x)}" @@ -1931,33 +1894,8 @@ then show ?thesis unfolding A_def by simp qed -lemma measurable_inequality_set [measurable]: - fixes f g::"_ \ 'a::{second_countable_topology, linorder_topology}" - assumes [measurable]: "f \ borel_measurable M" "g \ borel_measurable M" - shows "{x \ space M. f x \ g x} \ sets M" - "{x \ space M. f x < g x} \ sets M" - "{x \ space M. f x \ g x} \ sets M" - "{x \ space M. f x > g x} \ sets M" -proof - - define F where "F = (\x. (f x, g x))" - have * [measurable]: "F \ borel_measurable M" unfolding F_def by simp - - have "{x \ space M. f x \ g x} = F-`{(x, y) | x y. x \ y} \ space M" unfolding F_def by auto - moreover have "{(x, y) | x y. x \ (y::'a)} \ sets borel" using closed_subdiagonal borel_closed by blast - ultimately show "{x \ space M. f x \ g x} \ sets M" using * by (metis (mono_tags, lifting) measurable_sets) - - have "{x \ space M. f x < g x} = F-`{(x, y) | x y. x < y} \ space M" unfolding F_def by auto - moreover have "{(x, y) | x y. x < (y::'a)} \ sets borel" using open_subdiagonal borel_open by blast - ultimately show "{x \ space M. f x < g x} \ sets M" using * by (metis (mono_tags, lifting) measurable_sets) - - have "{x \ space M. f x \ g x} = F-`{(x, y) | x y. x \ y} \ space M" unfolding F_def by auto - moreover have "{(x, y) | x y. x \ (y::'a)} \ sets borel" using closed_superdiagonal borel_closed by blast - ultimately show "{x \ space M. f x \ g x} \ sets M" using * by (metis (mono_tags, lifting) measurable_sets) - - have "{x \ space M. f x > g x} = F-`{(x, y) | x y. x > y} \ space M" unfolding F_def by auto - moreover have "{(x, y) | x y. x > (y::'a)} \ sets borel" using open_superdiagonal borel_open by blast - ultimately show "{x \ space M. f x > g x} \ sets M" using * by (metis (mono_tags, lifting) measurable_sets) -qed +lemmas measurable_inequality_set [measurable] = + borel_measurable_le borel_measurable_less borel_measurable_le borel_measurable_less proposition measurable_limit [measurable]: fixes f::"nat \ 'a \ 'b::first_countable_topology" @@ -2051,8 +1989,8 @@ lemma measurable_restrict_mono: assumes f: "f \ restrict_space M A \\<^sub>M N" and "B \ A" shows "f \ restrict_space M B \\<^sub>M N" -by (rule measurable_compose[OF measurable_restrict_space3 f]) - (insert \B \ A\, auto) + by (rule measurable_compose[OF measurable_restrict_space3 f]) (use \B \ A\ in auto) + text \The next one is a variation around \measurable_piecewise_restrict\.\ @@ -2065,22 +2003,27 @@ fix B assume [measurable]: "B \ sets N" { fix n::nat - obtain h where [measurable]: "h \ measurable M N" and "\x \ A n. f x = h x" using assms(3) by blast + obtain h where [measurable]: "h \ measurable M N" and "\x \ A n. f x = h x" + using assms(3) by blast then have *: "f-`B \ A n = h-`B \ A n" by auto - have "h-`B \ A n = h-`B \ space M \ A n" using assms(2) sets.sets_into_space by auto - then have "h-`B \ A n \ sets M" by simp - then have "f-`B \ A n \ sets M" using * by simp + have "h-`B \ A n = h-`B \ space M \ A n" + using assms(2) sets.sets_into_space by auto + then have "f-`B \ A n \ sets M" + by (simp add: "*") } - then have "(\n. f-`B \ A n) \ sets M" by measurable - moreover have "f-`B \ space M = (\n. f-`B \ A n)" using assms(2) by blast + then have "(\n. f-`B \ A n) \ sets M" + by measurable + moreover have "f-`B \ space M = (\n. f-`B \ A n)" + using assms(2) by blast ultimately show "f-`B \ space M \ sets M" by simp next fix x assume "x \ space M" - then obtain n where "x \ A n" using assms(2) by blast - obtain h where [measurable]: "h \ measurable M N" and "\x \ A n. f x = h x" using assms(3) by blast - then have "f x = h x" using \x \ A n\ by blast - moreover have "h x \ space N" by (metis measurable_space \x \ space M\ \h \ measurable M N\) - ultimately show "f x \ space N" by simp + then obtain n where "x \ A n" + using assms(2) by blast + obtain h where [measurable]: "h \ measurable M N" and "\x \ A n. f x = h x" + using assms(3) by blast + then show "f x \ space N" + by (metis \x \ A n\ \x \ space M\ measurable_space) qed end diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Analysis/Complex_Analysis_Basics.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Complex_Analysis_Basics.thy Sat Aug 12 10:09:29 2023 +0100 @@ -138,25 +138,23 @@ fixes l::complex assumes "(f \ l) F" and "\ trivial_limit F" and "eventually P F" and "\a. P a \ f a \ \" shows "l \ \" -proof (rule Lim_in_closed_set[OF closed_complex_Reals _ assms(2,1)]) - show "eventually (\x. f x \ \) F" - using assms(3, 4) by (auto intro: eventually_mono) -qed + using Lim_in_closed_set[OF closed_complex_Reals] assms + by (smt (verit) eventually_mono) lemma real_lim_sequentially: fixes l::complex shows "(f \ l) sequentially \ (\N. \n\N. f n \ \) \ l \ \" -by (rule real_lim [where F=sequentially]) (auto simp: eventually_sequentially) + by (rule real_lim [where F=sequentially]) (auto simp: eventually_sequentially) lemma real_series: fixes l::complex shows "f sums l \ (\n. f n \ \) \ l \ \" -unfolding sums_def -by (metis real_lim_sequentially sum_in_Reals) + unfolding sums_def + by (metis real_lim_sequentially sum_in_Reals) lemma Lim_null_comparison_Re: assumes "eventually (\x. norm(f x) \ Re(g x)) F" "(g \ 0) F" shows "(f \ 0) F" - by (rule Lim_null_comparison[OF assms(1)] tendsto_eq_intros assms(2))+ simp + using Lim_null_comparison assms tendsto_Re by fastforce subsection\Holomorphic functions\ @@ -191,25 +189,11 @@ lemma holomorphic_on_UN_open: assumes "\n. n \ I \ f holomorphic_on A n" "\n. n \ I \ open (A n)" shows "f holomorphic_on (\n\I. A n)" -proof - - have "f field_differentiable at z within (\n\I. A n)" if "z \ (\n\I. A n)" for z - proof - - from that obtain n where "n \ I" "z \ A n" - by blast - hence "f holomorphic_on A n" "open (A n)" - by (simp add: assms)+ - with \z \ A n\ have "f field_differentiable at z" - by (auto simp: holomorphic_on_open field_differentiable_def) - thus ?thesis - by (meson field_differentiable_at_within) - qed - thus ?thesis - by (auto simp: holomorphic_on_def) -qed + by (metis UN_E assms holomorphic_on_open open_UN) lemma holomorphic_on_imp_continuous_on: "f holomorphic_on s \ continuous_on s f" - by (metis field_differentiable_imp_continuous_at continuous_on_eq_continuous_within holomorphic_on_def) + using differentiable_imp_continuous_on holomorphic_on_imp_differentiable_on by blast lemma holomorphic_closedin_preimage_constant: assumes "f holomorphic_on D" @@ -247,22 +231,15 @@ lemma constant_on_imp_holomorphic_on: assumes "f constant_on A" shows "f holomorphic_on A" -proof - - from assms obtain c where c: "\x\A. f x = c" - unfolding constant_on_def by blast - have "f holomorphic_on A \ (\_. c) holomorphic_on A" - by (intro holomorphic_cong) (use c in auto) - thus ?thesis - by simp -qed + by (metis assms constant_on_def holomorphic_on_const holomorphic_transform) lemma holomorphic_on_compose: - "f holomorphic_on s \ g holomorphic_on (f ` s) \ (g o f) holomorphic_on s" + "f holomorphic_on s \ g holomorphic_on (f ` s) \ (g \ f) holomorphic_on s" using field_differentiable_compose_within[of f _ s g] by (auto simp: holomorphic_on_def) lemma holomorphic_on_compose_gen: - "f holomorphic_on s \ g holomorphic_on t \ f ` s \ t \ (g o f) holomorphic_on s" + "f holomorphic_on s \ g holomorphic_on t \ f ` s \ t \ (g \ f) holomorphic_on s" by (metis holomorphic_on_compose holomorphic_on_subset) lemma holomorphic_on_balls_imp_entire: @@ -284,15 +261,10 @@ lemma holomorphic_on_balls_imp_entire': assumes "\r. r > 0 \ f holomorphic_on ball c r" shows "f holomorphic_on B" -proof (rule holomorphic_on_balls_imp_entire) - { - fix M :: real - have "\x. x > max M 0" by (intro gt_ex) - hence "\x>0. x > M" by auto - } - thus "\bdd_above {(0::real)<..}" unfolding bdd_above_def - by (auto simp: not_le) -qed (insert assms, auto) +proof (rule holomorphic_on_balls_imp_entire) + show "\bdd_above {(0::real)<..}" unfolding bdd_above_def + by (meson greaterThan_iff gt_ex less_le_not_le order_le_less_trans) +qed (use assms in auto) lemma holomorphic_on_minus [holomorphic_intros]: "f holomorphic_on A \ (\z. -(f z)) holomorphic_on A" by (metis field_differentiable_minus holomorphic_on_def) @@ -357,8 +329,7 @@ lemma holomorphic_on_Un [holomorphic_intros]: assumes "f holomorphic_on A" "f holomorphic_on B" "open A" "open B" shows "f holomorphic_on (A \ B)" - using assms by (auto simp: holomorphic_on_def at_within_open[of _ A] - at_within_open[of _ B] at_within_open[of _ "A \ B"] open_Un) + by (metis Un_iff assms holomorphic_on_open open_Un) lemma holomorphic_on_If_Un [holomorphic_intros]: assumes "f holomorphic_on A" "g holomorphic_on B" "open A" "open B" @@ -374,19 +345,16 @@ also have "g holomorphic_on B \ ?h holomorphic_on B" using assms by (intro holomorphic_cong) auto finally show \ . -qed (insert assms, auto) +qed (use assms in auto) lemma holomorphic_derivI: - "\f holomorphic_on S; open S; x \ S\ - \ (f has_field_derivative deriv f x) (at x within T)" -by (metis DERIV_deriv_iff_field_differentiable at_within_open holomorphic_on_def has_field_derivative_at_within) + "\f holomorphic_on S; open S; x \ S\ \ (f has_field_derivative deriv f x) (at x within T)" + by (metis DERIV_deriv_iff_field_differentiable at_within_open holomorphic_on_def has_field_derivative_at_within) lemma complex_derivative_transform_within_open: "\f holomorphic_on s; g holomorphic_on s; open s; z \ s; \w. w \ s \ f w = g w\ \ deriv f z = deriv g z" - unfolding holomorphic_on_def - by (rule DERIV_imp_deriv) - (metis DERIV_deriv_iff_field_differentiable has_field_derivative_transform_within_open at_within_open) + by (smt (verit) DERIV_imp_deriv has_field_derivative_transform_within_open holomorphic_on_open) lemma holomorphic_on_compose_cnj_cnj: assumes "f holomorphic_on cnj ` A" "open A" @@ -408,13 +376,13 @@ subsection\Analyticity on a set\ definition\<^marker>\tag important\ analytic_on (infixl "(analytic'_on)" 50) - where "f analytic_on S \ \x \ S. \e. 0 < e \ f holomorphic_on (ball x e)" + where "f analytic_on S \ \x \ S. \\. 0 < \ \ f holomorphic_on (ball x \)" named_theorems\<^marker>\tag important\ analytic_intros "introduction rules for proving analyticity" lemma analytic_imp_holomorphic: "f analytic_on S \ f holomorphic_on S" - by (simp add: at_within_open [OF _ open_ball] analytic_on_def holomorphic_on_def) - (metis centre_in_ball field_differentiable_at_within) + unfolding analytic_on_def holomorphic_on_def + using centre_in_ball field_differentiable_at_within field_differentiable_within_open by blast lemma analytic_on_open: "open S \ f analytic_on S \ f holomorphic_on S" by (meson analytic_imp_holomorphic analytic_on_def holomorphic_on_subset openE) @@ -426,15 +394,12 @@ lemma analytic_at_imp_isCont: assumes "f analytic_on {z}" shows "isCont f z" - using assms by (meson analytic_on_imp_differentiable_at field_differentiable_imp_continuous_at insertI1) + by (meson analytic_on_imp_differentiable_at assms field_differentiable_imp_continuous_at insertCI) lemma analytic_at_neq_imp_eventually_neq: assumes "f analytic_on {x}" "f x \ c" shows "eventually (\y. f y \ c) (at x)" -proof (intro tendsto_imp_eventually_ne) - show "f \x\ f x" - using assms by (simp add: analytic_at_imp_isCont isContD) -qed (use assms in auto) + using analytic_at_imp_isCont assms isContD tendsto_imp_eventually_ne by blast lemma analytic_on_subset: "f analytic_on S \ T \ S \ f analytic_on T" by (auto simp: analytic_on_def) @@ -455,18 +420,21 @@ have "?lhs \ (\T. open T \ S \ T \ f analytic_on T)" proof safe assume "f analytic_on S" - then show "\T. open T \ S \ T \ f analytic_on T" - apply (simp add: analytic_on_def) - apply (rule exI [where x="\{U. open U \ f analytic_on U}"], auto) - apply (metis open_ball analytic_on_open centre_in_ball) - by (metis analytic_on_def) + then have "\x \ \{U. open U \ f analytic_on U}. \\>0. f holomorphic_on ball x \" + using analytic_on_def by force + moreover have "S \ \{U. open U \ f analytic_on U}" + using \f analytic_on S\ + by (smt (verit, best) open_ball Union_iff analytic_on_def analytic_on_open centre_in_ball mem_Collect_eq subsetI) + ultimately show "\T. open T \ S \ T \ f analytic_on T" + unfolding analytic_on_def + by (metis (mono_tags, lifting) mem_Collect_eq open_Union) next fix T assume "open T" "S \ T" "f analytic_on T" then show "f analytic_on S" by (metis analytic_on_subset) qed - also have "... \ ?rhs" + also have "\ \ ?rhs" by (auto simp: analytic_on_open) finally show ?thesis . qed @@ -486,7 +454,7 @@ lemma analytic_on_compose: assumes f: "f analytic_on S" and g: "g analytic_on (f ` S)" - shows "(g o f) analytic_on S" + shows "(g \ f) analytic_on S" unfolding analytic_on_def proof (intro ballI) fix x @@ -500,21 +468,19 @@ with e' obtain d where d: "0 < d" and fd: "f ` ball x d \ ball (f x) e'" by (auto simp: continuous_at_ball) have "g \ f holomorphic_on ball x (min d e)" - apply (rule holomorphic_on_compose) - apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball) - by (metis fd gh holomorphic_on_subset image_mono min.cobounded1 subset_ball) + by (meson fd fh gh holomorphic_on_compose_gen holomorphic_on_subset image_mono min.cobounded1 min.cobounded2 subset_ball) then show "\e>0. g \ f holomorphic_on ball x e" by (metis d e min_less_iff_conj) qed lemma analytic_on_compose_gen: "f analytic_on S \ g analytic_on T \ (\z. z \ S \ f z \ T) - \ g o f analytic_on S" -by (metis analytic_on_compose analytic_on_subset image_subset_iff) + \ g \ f analytic_on S" + by (metis analytic_on_compose analytic_on_subset image_subset_iff) lemma analytic_on_neg [analytic_intros]: "f analytic_on S \ (\z. -(f z)) analytic_on S" -by (metis analytic_on_holomorphic holomorphic_on_minus) + by (metis analytic_on_holomorphic holomorphic_on_minus) lemma analytic_on_add [analytic_intros]: assumes f: "f analytic_on S" @@ -529,33 +495,11 @@ obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g by (metis analytic_on_def g z) have "(\z. f z + g z) holomorphic_on ball z (min e e')" - apply (rule holomorphic_on_add) - apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball) - by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball) + by (metis fh gh holomorphic_on_add holomorphic_on_subset linorder_linear min_def subset_ball) then show "\e>0. (\z. f z + g z) holomorphic_on ball z e" by (metis e e' min_less_iff_conj) qed -lemma analytic_on_diff [analytic_intros]: - assumes f: "f analytic_on S" - and g: "g analytic_on S" - shows "(\z. f z - g z) analytic_on S" -unfolding analytic_on_def -proof (intro ballI) - fix z - assume z: "z \ S" - then obtain e where e: "0 < e" and fh: "f holomorphic_on ball z e" using f - by (metis analytic_on_def) - obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g - by (metis analytic_on_def g z) - have "(\z. f z - g z) holomorphic_on ball z (min e e')" - apply (rule holomorphic_on_diff) - apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball) - by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball) - then show "\e>0. (\z. f z - g z) holomorphic_on ball z e" - by (metis e e' min_less_iff_conj) -qed - lemma analytic_on_mult [analytic_intros]: assumes f: "f analytic_on S" and g: "g analytic_on S" @@ -569,13 +513,23 @@ obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g by (metis analytic_on_def g z) have "(\z. f z * g z) holomorphic_on ball z (min e e')" - apply (rule holomorphic_on_mult) - apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball) - by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball) + by (metis fh gh holomorphic_on_mult holomorphic_on_subset min.absorb_iff2 min_def subset_ball) then show "\e>0. (\z. f z * g z) holomorphic_on ball z e" by (metis e e' min_less_iff_conj) qed +lemma analytic_on_diff [analytic_intros]: + assumes f: "f analytic_on S" and g: "g analytic_on S" + shows "(\z. f z - g z) analytic_on S" +proof - + have "(\z. - g z) analytic_on S" + by (simp add: analytic_on_neg g) + then have "(\z. f z + - g z) analytic_on S" + using analytic_on_add f by blast + then show ?thesis + by fastforce +qed + lemma analytic_on_inverse [analytic_intros]: assumes f: "f analytic_on S" and nz: "(\z. z \ S \ f z \ 0)" @@ -591,24 +545,20 @@ then obtain e' where e': "0 < e'" and nz': "\y. dist z y < e' \ f y \ 0" by (metis open_ball centre_in_ball continuous_on_open_avoid e z nz) have "(\z. inverse (f z)) holomorphic_on ball z (min e e')" - apply (rule holomorphic_on_inverse) - apply (metis fh holomorphic_on_subset min.cobounded2 min.commute subset_ball) - by (metis nz' mem_ball min_less_iff_conj) + using fh holomorphic_on_inverse holomorphic_on_open nz' by fastforce then show "\e>0. (\z. inverse (f z)) holomorphic_on ball z e" by (metis e e' min_less_iff_conj) qed lemma analytic_on_divide [analytic_intros]: - assumes f: "f analytic_on S" - and g: "g analytic_on S" - and nz: "(\z. z \ S \ g z \ 0)" - shows "(\z. f z / g z) analytic_on S" -unfolding divide_inverse -by (metis analytic_on_inverse analytic_on_mult f g nz) + assumes f: "f analytic_on S" and g: "g analytic_on S" + and nz: "(\z. z \ S \ g z \ 0)" + shows "(\z. f z / g z) analytic_on S" + unfolding divide_inverse by (metis analytic_on_inverse analytic_on_mult f g nz) lemma analytic_on_power [analytic_intros]: "f analytic_on S \ (\z. (f z) ^ n) analytic_on S" -by (induct n) (auto simp: analytic_on_mult) + by (induct n) (auto simp: analytic_on_mult) lemma analytic_on_power_int [analytic_intros]: assumes nz: "n \ 0 \ (\x\A. f x \ 0)" and f: "f analytic_on A" @@ -645,15 +595,15 @@ proof - have "deriv f w * deriv g (f w) = deriv g (f w) * deriv f w" by (simp add: algebra_simps) - also have "... = deriv (g o f) w" + also have "\ = deriv (g \ f) w" using assms by (metis analytic_on_imp_differentiable_at analytic_on_open deriv_chain image_subset_iff) - also have "... = deriv id w" + also have "\ = deriv id w" proof (rule complex_derivative_transform_within_open [where s=S]) show "g \ f holomorphic_on S" by (rule assms holomorphic_on_compose_gen holomorphic_intros)+ qed (use assms in auto) - also have "... = 1" + also have "\ = 1" by simp finally show ?thesis . qed @@ -679,19 +629,16 @@ lemma analytic_at_two: "f analytic_on {z} \ g analytic_on {z} \ - (\s. open s \ z \ s \ f holomorphic_on s \ g holomorphic_on s)" + (\S. open S \ z \ S \ f holomorphic_on S \ g holomorphic_on S)" (is "?lhs = ?rhs") proof assume ?lhs - then obtain s t - where st: "open s" "z \ s" "f holomorphic_on s" - "open t" "z \ t" "g holomorphic_on t" + then obtain S T + where st: "open S" "z \ S" "f holomorphic_on S" + "open T" "z \ T" "g holomorphic_on T" by (auto simp: analytic_at) - show ?rhs - apply (rule_tac x="s \ t" in exI) - using st - apply (auto simp: holomorphic_on_subset) - done + then show ?rhs + by (metis Int_iff holomorphic_on_subset inf_le1 inf_le2 open_Int) next assume ?rhs then show ?lhs @@ -707,32 +654,23 @@ and complex_derivative_mult_at: "deriv (\w. f w * g w) z = f z * deriv g z + deriv f z * g z" proof - - obtain s where s: "open s" "z \ s" "f holomorphic_on s" "g holomorphic_on s" - using assms by (metis analytic_at_two) show "deriv (\w. f w + g w) z = deriv f z + deriv g z" - apply (rule DERIV_imp_deriv [OF DERIV_add]) - using s - apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) - done + using analytic_on_imp_differentiable_at assms by auto show "deriv (\w. f w - g w) z = deriv f z - deriv g z" - apply (rule DERIV_imp_deriv [OF DERIV_diff]) - using s - apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) - done - show "deriv (\w. f w * g w) z = f z * deriv g z + deriv f z * g z" - apply (rule DERIV_imp_deriv [OF DERIV_mult']) - using s - apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) - done + using analytic_on_imp_differentiable_at assms by force + obtain S where "open S" "z \ S" "f holomorphic_on S" "g holomorphic_on S" + using assms by (metis analytic_at_two) + then show "deriv (\w. f w * g w) z = f z * deriv g z + deriv f z * g z" + by (simp add: DERIV_imp_deriv [OF DERIV_mult'] holomorphic_derivI) qed lemma deriv_cmult_at: "f analytic_on {z} \ deriv (\w. c * f w) z = c * deriv f z" -by (auto simp: complex_derivative_mult_at) + by (auto simp: complex_derivative_mult_at) lemma deriv_cmult_right_at: "f analytic_on {z} \ deriv (\w. f w * c) z = deriv f z * c" -by (auto simp: complex_derivative_mult_at) + by (auto simp: complex_derivative_mult_at) subsection\<^marker>\tag unimportant\\Complex differentiation of sequences and series\ @@ -748,27 +686,16 @@ proof - from assms obtain x l where x: "x \ S" and tf: "((\n. f n x) \ l) sequentially" by blast - { fix e::real assume e: "e > 0" - then obtain N where N: "\n\N. \x. x \ S \ cmod (f' n x - g' x) \ e" - by (metis conv) - have "\N. \n\N. \x\S. \h. cmod (f' n x * h - g' x * h) \ e * cmod h" - proof (rule exI [of _ N], clarify) - fix n y h - assume "N \ n" "y \ S" - then have "cmod (f' n y - g' y) \ e" - by (metis N) - then have "cmod h * cmod (f' n y - g' y) \ cmod h * e" - by (auto simp: antisym_conv2 mult_le_cancel_left norm_triangle_ineq2) - then show "cmod (f' n y * h - g' y * h) \ e * cmod h" - by (simp add: norm_mult [symmetric] field_simps) - qed - } note ** = this show ?thesis unfolding has_field_derivative_def proof (rule has_derivative_sequence [OF cvs _ _ x]) show "(\n. f n x) \ l" by (rule tf) - next show "\e. e > 0 \ \\<^sub>F n in sequentially. \x\S. \h. cmod (f' n x * h - g' x * h) \ e * cmod h" + next + have **: "\N. \n\N. \x\S. \h. cmod (f' n x * h - g' x * h) \ \ * cmod h" + if "\ > 0" for \::real + by (metis that left_diff_distrib mult_right_mono norm_ge_zero norm_mult conv) + show "\e. e > 0 \ \\<^sub>F n in sequentially. \x\S. \h. cmod (f' n x * h - g' x * h) \ e * cmod h" unfolding eventually_sequentially by (blast intro: **) qed (metis has_field_derivative_def df) qed @@ -784,19 +711,17 @@ proof - from assms obtain x l where x: "x \ S" and sf: "((\n. f n x) sums l)" by blast - { fix e::real assume e: "e > 0" + { fix \::real assume e: "\ > 0" then obtain N where N: "\n x. n \ N \ x \ S - \ cmod ((\i e" + \ cmod ((\i \" by (metis conv) - have "\N. \n\N. \x\S. \h. cmod ((\i e * cmod h" + have "\N. \n\N. \x\S. \h. cmod ((\i \ * cmod h" proof (rule exI [of _ N], clarify) fix n y h assume "N \ n" "y \ S" - then have "cmod ((\i e" - by (metis N) - then have "cmod h * cmod ((\i cmod h * e" - by (auto simp: antisym_conv2 mult_le_cancel_left norm_triangle_ineq2) - then show "cmod ((\i e * cmod h" + have "cmod h * cmod ((\i cmod h * \" + by (simp add: N \N \ n\ \y \ S\ mult_le_cancel_left) + then show "cmod ((\i \ * cmod h" by (simp add: norm_mult [symmetric] field_simps sum_distrib_left) qed } note ** = this @@ -818,8 +743,8 @@ lemma sum_Suc_reindex: fixes f :: "nat \ 'a::ab_group_add" - shows "sum f {0..n} = f 0 - f (Suc n) + sum (\i. f (Suc i)) {0..n}" -by (induct n) auto + shows "sum f {0..n} = f 0 - f (Suc n) + sum (\i. f (Suc i)) {0..n}" + by (induct n) auto lemma field_Taylor: assumes S: "convex S" @@ -836,7 +761,7 @@ assume "u \ closed_segment w z" then have "u \ S" by (metis wzs subsetD) - have "(\i\n. f i u * (- of_nat i * (z-u)^(i - 1)) / (fact i) + + have *: "(\i\n. f i u * (- of_nat i * (z-u)^(i - 1)) / (fact i) + f (Suc i) u * (z-u)^i / (fact i)) = f (Suc n) u * (z-u) ^ n / (fact n)" proof (induction n) @@ -849,7 +774,7 @@ f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n) / (fact (Suc n)) - f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n) / (fact (Suc n))" using Suc by simp - also have "... = f (Suc (Suc n)) u * (z-u) ^ Suc n / (fact (Suc n))" + also have "\ = f (Suc (Suc n)) u * (z-u) ^ Suc n / (fact (Suc n))" proof - have "(fact(Suc n)) * (f(Suc n) u *(z-u) ^ n / (fact n) + @@ -859,29 +784,26 @@ ((fact(Suc n)) *(f(Suc(Suc n)) u *((z-u) *(z-u) ^ n)) / (fact(Suc n))) - ((fact(Suc n)) *(f(Suc n) u *(of_nat(Suc n) *(z-u) ^ n))) / (fact(Suc n))" by (simp add: algebra_simps del: fact_Suc) - also have "... = ((fact (Suc n)) * (f (Suc n) u * (z-u) ^ n)) / (fact n) + + also have "\ = ((fact (Suc n)) * (f (Suc n) u * (z-u) ^ n)) / (fact n) + (f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)) - (f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n))" by (simp del: fact_Suc) - also have "... = (of_nat (Suc n) * (f (Suc n) u * (z-u) ^ n)) + + also have "\ = (of_nat (Suc n) * (f (Suc n) u * (z-u) ^ n)) + (f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)) - (f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n))" by (simp only: fact_Suc of_nat_mult ac_simps) simp - also have "... = f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)" + also have "\ = f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)" by (simp add: algebra_simps) finally show ?thesis by (simp add: mult_left_cancel [where c = "(fact (Suc n))", THEN iffD1] del: fact_Suc) qed finally show ?case . qed - then have "((\v. (\i\n. f i v * (z - v)^i / (fact i))) + have "((\v. (\i\n. f i v * (z - v)^i / (fact i))) has_field_derivative f (Suc n) u * (z-u) ^ n / (fact n)) (at u within S)" - apply (intro derivative_eq_intros) - apply (blast intro: assms \u \ S\) - apply (rule refl)+ - apply (auto simp: field_simps) - done + unfolding * [symmetric] + by (rule derivative_eq_intros assms \u \ S\ refl | auto simp: field_simps)+ } note sum_deriv = this { fix u assume u: "u \ closed_segment w z" @@ -889,9 +811,9 @@ by (metis wzs subsetD) have "norm (f (Suc n) u) * norm (z - u) ^ n \ norm (f (Suc n) u) * norm (u - z) ^ n" by (metis norm_minus_commute order_refl) - also have "... \ norm (f (Suc n) u) * norm (z - w) ^ n" + also have "\ \ norm (f (Suc n) u) * norm (z - w) ^ n" by (metis mult_left_mono norm_ge_zero power_mono segment_bound [OF u]) - also have "... \ B * norm (z - w) ^ n" + also have "\ \ B * norm (z - w) ^ n" by (metis norm_ge_zero zero_le_power mult_right_mono B [OF us]) finally have "norm (f (Suc n) u) * norm (z - u) ^ n \ B * norm (z - w) ^ n" . } note cmod_bound = this @@ -903,14 +825,14 @@ \ norm ((\i\n. f i w * (z - w) ^ i / (fact i)) - (\i\n. f i z * (z - z) ^ i / (fact i)))" by (simp add: norm_minus_commute) - also have "... \ B * norm (z - w) ^ n / (fact n) * norm (w - z)" - apply (rule field_differentiable_bound - [where f' = "\w. f (Suc n) w * (z - w)^n / (fact n)" - and S = "closed_segment w z", OF convex_closed_segment]) - apply (auto simp: DERIV_subset [OF sum_deriv wzs] - norm_divide norm_mult norm_power divide_le_cancel cmod_bound) - done - also have "... \ B * norm (z - w) ^ Suc n / (fact n)" + also have "\ \ B * norm (z - w) ^ n / (fact n) * norm (w - z)" + proof (rule field_differentiable_bound) + show "\x. x \ closed_segment w z \ + ((\\. \i\n. f i \ * (z - \) ^ i / fact i) has_field_derivative f (Suc n) x * (z - x) ^ n / fact n) + (at x within closed_segment w z)" + using DERIV_subset sum_deriv wzs by blast + qed (auto simp: norm_divide norm_mult norm_power divide_le_cancel cmod_bound) + also have "\ \ B * norm (z - w) ^ Suc n / (fact n)" by (simp add: algebra_simps norm_minus_commute) finally show ?thesis . qed @@ -921,8 +843,7 @@ and B: "\x. x \ S \ cmod (f (Suc n) x) \ B" and w: "w \ S" and z: "z \ S" - shows "cmod(f 0 z - (\i\n. f i w * (z-w) ^ i / (fact i))) - \ B * cmod(z - w)^(Suc n) / fact n" + shows "cmod(f 0 z - (\i\n. f i w * (z-w) ^ i / (fact i))) \ B * cmod(z - w)^(Suc n) / fact n" using assms by (rule field_Taylor) @@ -932,20 +853,22 @@ assumes "\u. u \ closed_segment w z \ (f has_field_derivative f'(u)) (at u)" shows "\u. u \ closed_segment w z \ Re(f z) - Re(f w) = Re(f'(u) * (z - w))" proof - - have twz: "\t. (1 - t) *\<^sub>R w + t *\<^sub>R z = w + t *\<^sub>R (z - w)" - by (simp add: real_vector.scale_left_diff_distrib real_vector.scale_right_diff_distrib) + define \ where "\ \ \t. (1 - t) *\<^sub>R w + t *\<^sub>R z" + have twz: "\t. \ t = w + t *\<^sub>R (z - w)" + by (simp add: \_def real_vector.scale_left_diff_distrib real_vector.scale_right_diff_distrib) note assms[unfolded has_field_derivative_def, derivative_intros] - show ?thesis - apply (cut_tac mvt_simple - [of 0 1 "Re o f o (\t. (1 - t) *\<^sub>R w + t *\<^sub>R z)" - "\u. Re o (\h. f'((1 - u) *\<^sub>R w + u *\<^sub>R z) * h) o (\t. t *\<^sub>R (z - w))"]) - apply auto - apply (rule_tac x="(1 - x) *\<^sub>R w + x *\<^sub>R z" in exI) - apply (auto simp: closed_segment_def twz) [] - apply (intro derivative_eq_intros has_derivative_at_withinI, simp_all) - apply (simp add: fun_eq_iff real_vector.scale_right_diff_distrib) - apply (force simp: twz closed_segment_def) - done + have *: "\x. \0 \ x; x \ 1\ + \ (Re \ f \ \ has_derivative Re \ (*) (f' (\ x)) \ (\t. t *\<^sub>R (z - w))) + (at x within {0..1})" + unfolding \_def + by (intro derivative_eq_intros has_derivative_at_withinI) + (auto simp: in_segment scaleR_right_diff_distrib) + obtain x where "0 f \ \) 1 - + (Re \ f \ \) 0 = (Re \ (*) (f' (\ x)) \ (\t. t *\<^sub>R (z - w))) (1 - 0)" + using mvt_simple [OF zero_less_one *] by force + then show ?thesis + unfolding \_def + by (smt (verit) comp_apply in_segment(1) scaleR_left_distrib scaleR_one scaleR_zero_left) qed lemma complex_Taylor_mvt: @@ -967,30 +890,27 @@ (f (Suc (Suc i)) u * ((z-u) ^ Suc i) - of_nat (Suc i) * (f (Suc i) u * (z-u) ^ i)) / (fact (Suc i)))" by (subst sum_Suc_reindex) simp - also have "... = f (Suc 0) u - + also have "\ = f (Suc 0) u - (f (Suc (Suc n)) u * ((z-u) ^ Suc n) - (of_nat (Suc n)) * (z-u) ^ n * f (Suc n) u) / (fact (Suc n)) + (\i = 0..n. f (Suc (Suc i)) u * ((z-u) ^ Suc i) / (fact (Suc i)) - f (Suc i) u * (z-u) ^ i / (fact i))" by (simp only: diff_divide_distrib fact_cancel ac_simps) - also have "... = f (Suc 0) u - + also have "\ = f (Suc 0) u - (f (Suc (Suc n)) u * (z-u) ^ Suc n - of_nat (Suc n) * (z-u) ^ n * f (Suc n) u) / (fact (Suc n)) + f (Suc (Suc n)) u * (z-u) ^ Suc n / (fact (Suc n)) - f (Suc 0) u" by (subst sum_Suc_diff) auto - also have "... = f (Suc n) u * (z-u) ^ n / (fact n)" + also have "\ = f (Suc n) u * (z-u) ^ n / (fact n)" by (simp only: algebra_simps diff_divide_distrib fact_cancel) - finally have "(\i = 0..n. (f (Suc i) u * (z - u) ^ i + finally have *: "(\i = 0..n. (f (Suc i) u * (z - u) ^ i - of_nat i * (f i u * (z-u) ^ (i - Suc 0))) / (fact i)) = f (Suc n) u * (z - u) ^ n / (fact n)" . - then have "((\u. \i = 0..n. f i u * (z - u) ^ i / (fact i)) has_field_derivative + have "((\u. \i = 0..n. f i u * (z - u) ^ i / (fact i)) has_field_derivative f (Suc n) u * (z - u) ^ n / (fact n)) (at u)" - apply (intro derivative_eq_intros)+ - apply (force intro: u assms) - apply (rule refl)+ - apply (auto simp: ac_simps) - done + unfolding * [symmetric] + by (rule derivative_eq_intros assms u refl | auto simp: field_simps)+ } then show ?thesis apply (cut_tac complex_mvt_line [of w z "\u. \i = 0..n. f i u * (z-u) ^ i / (fact i)" diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Sat Aug 12 10:09:29 2023 +0100 @@ -437,7 +437,7 @@ then obtain L where L: "subspace L" "affine_parallel S L" using assms affine_parallel_subspace[of S] by auto then obtain a where a: "S = ((+) a ` L)" - using affine_parallel_def[of L S] affine_parallel_commut by auto + using affine_parallel_def[of L S] affine_parallel_commute by auto from L have "closed L" using closed_subspace by auto then have "closed S" using closed_translation a by auto diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Elementary_Topology.thy Sat Aug 12 10:09:29 2023 +0100 @@ -1692,20 +1692,15 @@ (\f. (\n. f n \ S) \ (\l\S. \r::nat\nat. strict_mono r \ (f \ r) \ l))" lemma seq_compactI: - assumes "\f. \n. f n \ S \ \l\S. \r::nat\nat. strict_mono r \ ((f \ r) \ l) sequentially" + assumes "\f. \n. f n \ S \ \l\S. \r::nat\nat. strict_mono r \ (f \ r) \ l" shows "seq_compact S" unfolding seq_compact_def using assms by fast lemma seq_compactE: assumes "seq_compact S" "\n. f n \ S" - obtains l r where "l \ S" "strict_mono (r :: nat \ nat)" "((f \ r) \ l) sequentially" + obtains l r where "l \ S" "strict_mono (r :: nat \ nat)" "(f \ r) \ l" using assms unfolding seq_compact_def by fast -lemma closed_sequentially: (* TODO: move upwards *) - assumes "closed S" and "\n. f n \ S" and "f \ l" - shows "l \ S" - by (metis Lim_in_closed_set assms eventually_sequentially trivial_limit_sequentially) - lemma seq_compact_Int_closed: assumes "seq_compact S" and "closed T" shows "seq_compact (S \ T)" diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Sat Aug 12 10:09:29 2023 +0100 @@ -1373,7 +1373,7 @@ obtain a where "a \ interior (convex hull insert 0 B)" proof (rule interior_simplex_nonempty [OF indB]) show "finite B" - by (simp add: indB independent_finite) + by (simp add: indB independent_imp_finite) show "card B = DIM('N)" by (simp add: cardB 2) qed diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Finite_Product_Measure.thy --- a/src/HOL/Analysis/Finite_Product_Measure.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Finite_Product_Measure.thy Sat Aug 12 10:09:29 2023 +0100 @@ -8,9 +8,11 @@ imports Binary_Product_Measure Function_Topology begin -lemma PiE_choice: "(\f\Pi\<^sub>E I F. \i\I. P i (f i)) \ (\i\I. \x\F i. P i x)" - by (auto simp: Bex_def PiE_iff Ball_def dest!: choice_iff'[THEN iffD1]) - (force intro: exI[of _ "restrict f I" for f]) +lemma Pi_choice: "(\i\I. \x\F i. P i x) \ (\f\Pi I F. \i\I. P i (f i))" + by (metis Pi_iff) + +lemma PiE_choice: "(\i\I. \x\F i. P i x) \(\f\Pi\<^sub>E I F. \i\I. P i (f i))" + unfolding Pi_choice by (metis Int_iff PiE_def restrict_PiE restrict_apply) lemma case_prod_const: "(\(i, j). c) = (\_. c)" by auto @@ -97,7 +99,7 @@ then show "x \ A \ x \ B" using y x \J \ I\ PiE_cancel_merge[of "J" "I - J" x y S] by (auto simp del: PiE_cancel_merge simp add: Un_absorb1 eq) - qed (insert sets, auto) + qed (use sets in auto) qed lemma restrict_vimage: @@ -178,7 +180,7 @@ lemma Pi_cong_sets: "\I = J; \x. x \ I \ M x = N x\ \ Pi I M = Pi J N" - unfolding Pi_def by auto + by auto lemma PiM_cong: assumes "I = J" "\x. x \ I \ M x = N x" @@ -327,17 +329,11 @@ done qed proposition prod_algebra_cong: - assumes "I = J" and sets: "(\i. i \ I \ sets (M i) = sets (N i))" + assumes "I = J" and "(\i. i \ I \ sets (M i) = sets (N i))" shows "prod_algebra I M = prod_algebra J N" -proof - - have space: "\i. i \ I \ space (M i) = space (N i)" - using sets_eq_imp_space_eq[OF sets] by auto - with sets show ?thesis unfolding \I = J\ - by (intro antisym prod_algebra_mono) auto -qed + by (metis assms prod_algebra_mono sets_eq_imp_space_eq subsetI subset_antisym) -lemma space_in_prod_algebra: - "(\\<^sub>E i\I. space (M i)) \ prod_algebra I M" +lemma space_in_prod_algebra: "(\\<^sub>E i\I. space (M i)) \ prod_algebra I M" proof cases assume "I = {}" then show ?thesis by (auto simp add: prod_algebra_def image_iff prod_emb_def) @@ -346,9 +342,8 @@ then obtain i where "i \ I" by auto then have "(\\<^sub>E i\I. space (M i)) = prod_emb I M {i} (\\<^sub>E i\{i}. space (M i))" by (auto simp: prod_emb_def) - also have "\ \ prod_algebra I M" - using \i \ I\ by (intro prod_algebraI) auto - finally show ?thesis . + then show ?thesis + by (simp add: \i \ I\ prod_algebraI) qed lemma space_PiM: "space (\\<^sub>M i\I. M i) = (\\<^sub>E i\I. space (M i))" @@ -383,8 +378,8 @@ show "A \ sigma_sets ?\ ?R" proof cases assume "I = {}" - with X have "A = {\x. undefined}" by (auto simp: prod_emb_def) - with \I = {}\ show ?thesis by (auto intro!: sigma_sets_top) + with X show ?thesis + by (metis (no_types, lifting) PiE_cong R.top empty_iff prod_emb_PiE subset_eq) next assume "I \ {}" with X have "A = (\j\J. {f\(\\<^sub>E i\I. space (M i)). f j \ X j})" @@ -405,16 +400,25 @@ qed lemma sets_PiM_eq_proj: - "I \ {} \ sets (PiM I M) = sets (SUP i\I. vimage_algebra (\\<^sub>E i\I. space (M i)) (\x. x i) (M i))" - apply (simp add: sets_PiM_single) - apply (subst sets_Sup_eq[where X="\\<^sub>E i\I. space (M i)"]) - apply auto [] - apply auto [] - apply simp - apply (subst arg_cong [of _ _ Sup, OF image_cong, OF refl]) - apply (rule sets_vimage_algebra2) - apply (auto intro!: arg_cong2[where f=sigma_sets]) - done + assumes "I \ {}" + shows "sets (PiM I M) = sets (SUP i\I. vimage_algebra (\\<^sub>E i\I. space (M i)) (\x. x i) (M i))" + (is "?lhs = ?rhs") +proof - + have "?lhs = + sigma_sets (\\<^sub>E i\I. space (M i)) {{f \ \\<^sub>E i\I. space (M i). f i \ A} |i A. i \ I \ A \ sets (M i)}" + by (simp add: sets_PiM_single) + also have "\ = sigma_sets (\\<^sub>E i\I. space (M i)) + (\x\I. sets (vimage_algebra (\\<^sub>E i\I. space (M i)) (\xa. xa x) (M x)))" + apply (subst arg_cong [of _ _ Sup, OF image_cong, OF refl]) + apply (rule sets_vimage_algebra2) + by (auto intro!: arg_cong2[where f=sigma_sets]) + also have "... = sigma_sets (\\<^sub>E i\I. space (M i)) + (\ (sets ` (\i. vimage_algebra (\\<^sub>E i\I. space (M i)) (\x. x i) (M i)) ` I))" + by simp + also have "... = ?rhs" + by (subst sets_Sup_eq[where X="\\<^sub>E i\I. space (M i)"]) (use assms in auto) + finally show ?thesis . +qed lemma shows space_PiM_empty: "space (Pi\<^sub>M {} M) = {\k. undefined}" @@ -616,7 +620,7 @@ by (fastforce dest: Pi_mem simp: prod_emb_def space_PiM split: if_split_asm) then show "(\x. x i) -` A \ space (Pi\<^sub>M I M) \ sets (Pi\<^sub>M I M)" using \A \ sets (M i)\ \i \ I\ by (auto intro!: sets_PiM_I) -qed (insert \i \ I\, auto simp: space_PiM) +qed (use \i \ I\ in \auto simp: space_PiM\) lemma measurable_component_singleton'[measurable_dest]: assumes f: "f \ measurable N (Pi\<^sub>M I M)" @@ -696,7 +700,10 @@ by auto then show "{\ \ space N. (\i\I. X i \) i \ A} \ sets N" using A X by (auto intro!: measurable_sets) -qed (insert X, auto simp add: PiE_def dest: measurable_space) +next + show "(\x. \i\I. X i x) \ space N \ (\\<^sub>E i\I. space (M i))" + using X by (auto simp add: PiE_def dest: measurable_space) +qed lemma measurable_abs_UNIV: "(\n. (\\. f n \) \ measurable M (N n)) \ (\\ n. f n \) \ measurable M (PiM UNIV N)" @@ -708,13 +715,7 @@ lemma measurable_restrict_subset': assumes "J \ L" "\x. x \ J \ sets (M x) = sets (N x)" shows "(\f. restrict f J) \ measurable (Pi\<^sub>M L M) (Pi\<^sub>M J N)" -proof- - from assms(1) have "(\f. restrict f J) \ measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M)" - by (rule measurable_restrict_subset) - also from assms(2) have "measurable (Pi\<^sub>M L M) (Pi\<^sub>M J M) = measurable (Pi\<^sub>M L M) (Pi\<^sub>M J N)" - by (intro sets_PiM_cong measurable_cong_sets) simp_all - finally show ?thesis . -qed + by (metis (no_types) assms measurable_cong_sets measurable_restrict_subset sets_PiM_cong) lemma measurable_prod_emb[intro, simp]: "J \ L \ X \ sets (Pi\<^sub>M J M) \ prod_emb L M J X \ sets (Pi\<^sub>M L M)" @@ -754,11 +755,7 @@ lemma sets_in_extensional_aux: "{x\space (PiM I M). x \ extensional I} \ sets (PiM I M)" -proof - - have "{x\space (PiM I M). x \ extensional I} = space (PiM I M)" - by (auto simp add: extensional_def space_PiM) - then show ?thesis by simp -qed + by (smt (verit) PiE_iff mem_Collect_eq sets.top space_PiM subsetI subset_antisym) lemma sets_in_extensional[measurable (raw)]: "f \ measurable N (PiM I M) \ Measurable.pred N (\x. f x \ extensional I)" @@ -772,7 +769,7 @@ then have "Pi\<^sub>E I E = (\i\I. prod_emb I M {i} (Pi\<^sub>E {i} E))" using E[THEN sets.sets_into_space] by (auto simp: PiE_iff prod_emb_def fun_eq_iff) also have "\ \ sets (PiM I M)" - using I \I \ {}\ by (safe intro!: sets.countable_INT' measurable_prod_emb sets_PiM_I_finite E) + using I \I \ {}\ by (simp add: E sets.countable_INT' sets_PiM_I subset_eq) finally show ?thesis . qed (simp add: sets_PiM_empty) @@ -805,8 +802,9 @@ and K: "\i. K i = prod_emb I M (J i) (X i)" by (metis Union.IH) show ?case - proof (intro exI[of _ "\i. J i"] bexI[of _ "\i. prod_emb (\i. J i) M (J i) (X i)"] conjI) - show "(\i. J i) \ I" "countable (\i. J i)" using J by auto + proof (intro exI bexI conjI) + show "(\i. J i) \ I" "countable (\i. J i)" + using J by auto with J show "\(K ` UNIV) = prod_emb I M (\i. J i) (\i. prod_emb (\i. J i) M (J i) (X i))" by (simp add: K[abs_def] SUP_upper) qed(auto intro: X) @@ -1010,7 +1008,7 @@ in_space: "\j. space (M j) = \(F j)" using sigma_finite_countable by (metis subset_eq) moreover have "(\(Pi\<^sub>E I ` Pi\<^sub>E I F)) = space (Pi\<^sub>M I M)" - using in_space by (auto simp: space_PiM PiE_iff intro!: PiE_choice[THEN iffD2]) + using in_space by (auto simp: space_PiM PiE_iff intro!: PiE_choice[THEN iffD1]) ultimately show "\A. countable A \ A \ sets (Pi\<^sub>M I M) \ \A = space (Pi\<^sub>M I M) \ (\a\A. emeasure (Pi\<^sub>M I M) a \ \)" by (intro exI[of _ "Pi\<^sub>E I ` Pi\<^sub>E I F"]) (auto intro!: countable_PiE sets_PiM_I_finite @@ -1042,26 +1040,26 @@ (\i\I \ J. emeasure (M i) (A i))" by (subst emeasure_distr) (auto simp: * J.emeasure_pair_measure_Times I.measure_times J.measure_times prod.union_disjoint) -qed (insert fin, simp_all) +qed (use fin in simp_all) proposition (in product_sigma_finite) product_nn_integral_fold: assumes IJ: "I \ J = {}" "finite I" "finite J" and f[measurable]: "f \ borel_measurable (Pi\<^sub>M (I \ J) M)" - shows "integral\<^sup>N (Pi\<^sub>M (I \ J) M) f = - (\\<^sup>+ x. (\\<^sup>+ y. f (merge I J (x, y)) \(Pi\<^sub>M J M)) \(Pi\<^sub>M I M))" +shows "integral\<^sup>N (Pi\<^sub>M (I \ J) M) f = (\\<^sup>+ x. (\\<^sup>+ y. f (merge I J (x, y)) \(Pi\<^sub>M J M)) \(Pi\<^sub>M I M))" + (is "?lhs = ?rhs") proof - interpret I: finite_product_sigma_finite M I by standard fact interpret J: finite_product_sigma_finite M J by standard fact interpret P: pair_sigma_finite "Pi\<^sub>M I M" "Pi\<^sub>M J M" by standard have P_borel: "(\x. f (merge I J x)) \ borel_measurable (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" using measurable_comp[OF measurable_merge f] by (simp add: comp_def) - show ?thesis - apply (subst distr_merge[OF IJ, symmetric]) - apply (subst nn_integral_distr[OF measurable_merge]) - apply measurable [] - apply (subst J.nn_integral_fst[symmetric, OF P_borel]) - apply simp - done + have "?lhs = integral\<^sup>N (distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J)) f" + by (simp add: I.finite_index J.finite_index assms(1) distr_merge) + also have "... = \\<^sup>+ x. f (merge I J x) \(Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" + by (simp add: nn_integral_distr) + also have "... = ?rhs" + using P.Fubini P.nn_integral_snd by force + finally show ?thesis . qed lemma (in product_sigma_finite) distr_singleton: @@ -1082,10 +1080,7 @@ proof - interpret I: finite_product_sigma_finite M "{i}" by standard simp from f show ?thesis - apply (subst distr_singleton[symmetric]) - apply (subst nn_integral_distr[OF measurable_component_singleton]) - apply simp_all - done + by (metis distr_singleton insert_iff measurable_component_singleton nn_integral_distr) qed proposition (in product_sigma_finite) product_nn_integral_insert: @@ -1118,8 +1113,7 @@ shows "integral\<^sup>N (Pi\<^sub>M (insert i I) M) f = (\\<^sup>+ y. (\\<^sup>+ x. f (x(i := y)) \(Pi\<^sub>M I M)) \(M i))" apply (subst product_nn_integral_insert[OF assms]) apply (rule pair_sigma_finite.Fubini') - apply intro_locales [] - apply (rule sigma_finite[OF I(1)]) + apply (simp add: local.sigma_finite pair_sigma_finite.intro sigma_finite_measures) apply measurable done @@ -1139,11 +1133,8 @@ measurable_comp[OF measurable_component_singleton, unfolded comp_def]) auto then show ?case - apply (simp add: product_nn_integral_insert[OF insert(1,2)]) - apply (simp add: insert(2-) * nn_integral_multc) - apply (subst nn_integral_cmult) - apply (auto simp add: insert(2-)) - done + using product_nn_integral_insert[OF insert(1,2)] + by (simp add: insert(2-) * nn_integral_multc nn_integral_cmult) qed (simp add: space_PiM) proposition (in product_sigma_finite) product_nn_integral_pair: @@ -1176,7 +1167,8 @@ lemma (in product_sigma_finite) assumes IJ: "I \ J = {}" "finite I" "finite J" and A: "A \ sets (Pi\<^sub>M (I \ J) M)" shows emeasure_fold_integral: - "emeasure (Pi\<^sub>M (I \ J) M) A = (\\<^sup>+x. emeasure (Pi\<^sub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^sub>M J M)) \Pi\<^sub>M I M)" (is ?I) + "emeasure (Pi\<^sub>M (I \ J) M) A = (\\<^sup>+x. emeasure (Pi\<^sub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^sub>M J M)) \Pi\<^sub>M I M)" + (is "?lhs = ?rhs") and emeasure_fold_measurable: "(\x. emeasure (Pi\<^sub>M J M) ((\y. merge I J (x, y)) -` A \ space (Pi\<^sub>M J M))) \ borel_measurable (Pi\<^sub>M I M)" (is ?B) proof - @@ -1185,13 +1177,14 @@ interpret IJ: pair_sigma_finite "Pi\<^sub>M I M" "Pi\<^sub>M J M" .. have merge: "merge I J -` A \ space (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) \ sets (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M)" by (intro measurable_sets[OF _ A] measurable_merge assms) - - show ?I - apply (subst distr_merge[symmetric, OF IJ]) - apply (subst emeasure_distr[OF measurable_merge A]) + have "?lhs = emeasure (distr (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (Pi\<^sub>M (I \ J) M) (merge I J)) A" + by (simp add: I.finite_index J.finite_index assms(1) distr_merge) + also have "... = emeasure (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M) (merge I J -` A \ space (Pi\<^sub>M I M \\<^sub>M Pi\<^sub>M J M))" + by (meson A emeasure_distr measurable_merge) + also have "... = ?rhs" apply (subst J.emeasure_pair_measure_alt[OF merge]) - apply (auto intro!: nn_integral_cong arg_cong2[where f=emeasure] simp: space_pair_measure) - done + by (auto intro!: nn_integral_cong arg_cong2[where f=emeasure] simp: space_pair_measure) + finally show "?lhs = ?rhs" . show ?B using IJ.measurable_emeasure_Pair1[OF merge] @@ -1201,7 +1194,6 @@ lemma sets_Collect_single: "i \ I \ A \ sets (M i) \ { x \ space (Pi\<^sub>M I M). x i \ A } \ sets (Pi\<^sub>M I M)" by simp - lemma pair_measure_eq_distr_PiM: fixes M1 :: "'a measure" and M2 :: "'a measure" assumes "sigma_finite_measure M1" "sigma_finite_measure M2" @@ -1282,7 +1274,7 @@ {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" proof have "{(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}} \ sets (Pi\<^sub>M I M)" - proof (auto) + proof clarify fix X assume H: "\i. X i \ sets (M i)" "finite {i. X i \ space (M i)}" then have *: "X i \ sets (M i)" for i by simp define J where "J = {i \ I. X i \ space (M i)}" @@ -1315,9 +1307,7 @@ qed show "sets (Pi\<^sub>M I M) \ sigma_sets (\\<^sub>E i\I. space (M i)) {(\\<^sub>E i\I. X i) |X. (\i. X i \ sets (M i)) \ finite {i. X i \ space (M i)}}" unfolding sets_PiM_single - apply (rule sigma_sets_mono') - apply (auto simp add: PiE_iff *) - done + by (intro sigma_sets_mono') (auto simp add: PiE_iff *) qed lemma sets_PiM_subset_borel: @@ -1361,7 +1351,7 @@ ultimately show ?thesis unfolding \U = (\B)\ by auto qed have "sigma_sets UNIV (Collect open) \ sets (Pi\<^sub>M UNIV (\i::'a. (borel::('b measure))))" - apply (rule sets.sigma_sets_subset') using ** by auto + by (metis "**" mem_Collect_eq open_UNIV sets.sigma_sets_subset' subsetI) then show "sets (borel::('a \ 'b) measure) \ sets (Pi\<^sub>M UNIV (\_. borel))" unfolding borel_def by auto qed (simp add: sets_PiM_subset_borel) diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Further_Topology.thy --- a/src/HOL/Analysis/Further_Topology.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Further_Topology.thy Sat Aug 12 10:09:29 2023 +0100 @@ -30,9 +30,9 @@ proof have "\u. \u \ S; norm u *\<^sub>R f (u /\<^sub>R norm u) \ T\ \ u = 0" by (metis (mono_tags, lifting) DiffI subS01 subspace_mul [OF \subspace T\] fim image_subset_iff inf_le2 singletonD) - then have "g ` (S - {0}) \ T" + then have "g \ (S - {0}) \ T" using g_def by blast - moreover have "g ` (S - {0}) \ UNIV - {0}" + moreover have "g \ (S - {0}) \ UNIV - {0}" proof (clarsimp simp: g_def) fix y assume "y \ S" and f0: "f (y /\<^sub>R norm y) = 0" @@ -159,30 +159,24 @@ assumes ST: "subspace S" "subspace T" "dim S < dim T" and "S \ T" and contf: "continuous_on (sphere 0 1 \ S) f" - and fim: "f ` (sphere 0 1 \ S) \ sphere 0 1 \ T" + and fim: "f \ (sphere 0 1 \ S) \ sphere 0 1 \ T" shows "\c. homotopic_with_canon (\x. True) (sphere 0 1 \ S) (sphere 0 1 \ T) f (\x. c)" proof - have [simp]: "\x. \norm x = 1; x \ S\ \ norm (f x) = 1" - using fim by (simp add: image_subset_iff) + using fim by auto have "compact (sphere 0 1 \ S)" by (simp add: \subspace S\ closed_subspace compact_Int_closed) - then obtain g where pfg: "polynomial_function g" and gim: "g ` (sphere 0 1 \ S) \ T" + then obtain g where pfg: "polynomial_function g" and gim: "g \ (sphere 0 1 \ S) \ T" and g12: "\x. x \ sphere 0 1 \ S \ norm(f x - g x) < 1/2" - using Stone_Weierstrass_polynomial_function_subspace [OF _ contf _ \subspace T\, of "1/2"] fim by auto + using Stone_Weierstrass_polynomial_function_subspace [OF _ contf _ \subspace T\, of "1/2"] fim + by (auto simp: image_subset_iff_funcset) have gnz: "g x \ 0" if "x \ sphere 0 1 \ S" for x - proof - - have "norm (f x) = 1" - using fim that by (simp add: image_subset_iff) - then show ?thesis - using g12 [OF that] by auto - qed + using g12 that by fastforce have diffg: "g differentiable_on sphere 0 1 \ S" by (metis pfg differentiable_on_polynomial_function) define h where "h \ \x. inverse(norm(g x)) *\<^sub>R g x" have h: "x \ sphere 0 1 \ S \ h x \ sphere 0 1 \ T" for x - unfolding h_def - using gnz [of x] - by (auto simp: subspace_mul [OF \subspace T\] subsetD [OF gim]) + unfolding h_def using \subspace T\ gim gnz subspace_mul by fastforce have diffh: "h differentiable_on sphere 0 1 \ S" unfolding h_def using gnz by (fastforce intro: derivative_intros diffg differentiable_on_compose [OF diffg]) @@ -205,7 +199,7 @@ have "convex T" by (simp add: \subspace T\ subspace_imp_convex) then have "convex hull {f x, g x} \ T" - by (metis IntD2 closed_segment_subset fim gim image_subset_iff segment_convex_hull that) + by (metis IntD2 PiE closed_segment_subset fim gim segment_convex_hull that) then show ?thesis using that non0fg segment_convex_hull by fastforce qed @@ -279,14 +273,9 @@ then have affS_eq: "aff_dim S = aff_dim (ball 0 1 \ T)" using \aff_dim T = aff_dim S\ by simp have "rel_frontier S homeomorphic rel_frontier(ball 0 1 \ T)" - proof (rule homeomorphic_rel_frontiers_convex_bounded_sets [OF \convex S\ \bounded S\]) - show "convex (ball 0 1 \ T)" - by (simp add: \subspace T\ convex_Int subspace_imp_convex) - show "bounded (ball 0 1 \ T)" - by (simp add: bounded_Int) - show "aff_dim S = aff_dim (ball 0 1 \ T)" - by (rule affS_eq) - qed + using homeomorphic_rel_frontiers_convex_bounded_sets [OF \convex S\ \bounded S\] + by (simp add: \subspace T\ affS_eq assms bounded_Int convex_Int + homeomorphic_rel_frontiers_convex_bounded_sets subspace_imp_convex) also have "... = frontier (ball 0 1) \ T" proof (rule convex_affine_rel_frontier_Int [OF convex_ball]) show "affine T" @@ -318,10 +307,8 @@ then show ?thesis proof (cases "T = {}") case True - then have "rel_frontier S = {}" "rel_frontier T = {}" - using fim by fastforce+ then show ?thesis - using that by (simp add: homotopic_on_emptyI) + by (smt (verit, best) False affST aff_dim_negative_iff) next case False obtain T':: "'a set" @@ -383,16 +370,16 @@ assumes fin: "finite \" and "\S. S \ \ \ closed S" and "\S T. \S \ \; T \ \; S \ T\ \ S \ T \ K" - and "\S. S \ \ \ \g. continuous_on S g \ g ` S \ T \ (\x \ S \ K. g x = h x)" - shows "\g. continuous_on (\\) g \ g ` (\\) \ T \ (\x \ \\ \ K. g x = h x)" + and "\S. S \ \ \ \g. continuous_on S g \ g \ S \ T \ (\x \ S \ K. g x = h x)" + shows "\g. continuous_on (\\) g \ g \ (\\) \ T \ (\x \ \\ \ K. g x = h x)" using assms proof (induction \) case empty show ?case by simp next case (insert S \) - then obtain f where contf: "continuous_on (S) f" and fim: "f ` S \ T" and feq: "\x \ S \ K. f x = h x" - by (meson insertI1) - obtain g where contg: "continuous_on (\\) g" and gim: "g ` \\ \ T" and geq: "\x \ \\ \ K. g x = h x" + then obtain f where contf: "continuous_on S f" and fim: "f \ S \ T" and feq: "\x \ S \ K. f x = h x" + by (metis funcset_image insert_iff) + obtain g where contg: "continuous_on (\\) g" and gim: "g \ (\\) \ T" and geq: "\x \ \\ \ K. g x = h x" using insert by auto have fg: "f x = g x" if "x \ T" "T \ \" "x \ S" for x T proof - @@ -403,38 +390,38 @@ qed moreover have "continuous_on (S \ \ \) (\x. if x \ S then f x else g x)" by (auto simp: insert closed_Union contf contg intro: fg continuous_on_cases) + moreover have "S \ \ \ = \ (insert S \)" + by auto ultimately show ?case - by (smt (verit, del_insts) Int_iff UnE complete_lattice_class.Sup_insert feq fim geq gim image_subset_iff) + by (smt (verit) Int_iff Pi_iff UnE feq fim geq gim) qed lemma extending_maps_Union: assumes fin: "finite \" - and "\S. S \ \ \ \g. continuous_on S g \ g ` S \ T \ (\x \ S \ K. g x = h x)" - and "\S. S \ \ \ closed S" - and K: "\X Y. \X \ \; Y \ \; \ X \ Y; \ Y \ X\ \ X \ Y \ K" - shows "\g. continuous_on (\\) g \ g ` (\\) \ T \ (\x \ \\ \ K. g x = h x)" -apply (simp flip: Union_maximal_sets [OF fin]) -apply (rule extending_maps_Union_aux) -apply (simp_all add: Union_maximal_sets [OF fin] assms) -by (metis K psubsetI) - + and "\S. S \ \ \ \g. continuous_on S g \ g \ S \ T \ (\x \ S \ K. g x = h x)" + and "\S. S \ \ \ closed S" + and K: "\X Y. \X \ \; Y \ \; \ X \ Y; \ Y \ X\ \ X \ Y \ K" + shows "\g. continuous_on (\\) g \ g \ (\\) \ T \ (\x \ \\ \ K. g x = h x)" +proof - + have "\S T. \S \ \; \U\\. \ S \ U; T \ \; \U\\. \ T \ U; S \ T\ \ S \ T \ K" + by (metis K psubsetI) + then show ?thesis + apply (simp flip: Union_maximal_sets [OF fin]) + apply (rule extending_maps_Union_aux, simp_all add: Union_maximal_sets [OF fin] assms) + done +qed lemma extend_map_lemma: assumes "finite \" "\ \ \" "convex T" "bounded T" and poly: "\X. X \ \ \ polytope X" and aff: "\X. X \ \ - \ \ aff_dim X < aff_dim T" and face: "\S T. \S \ \; T \ \\ \ (S \ T) face_of S" - and contf: "continuous_on (\\) f" and fim: "f ` (\\) \ rel_frontier T" - obtains g where "continuous_on (\\) g" "g ` (\\) \ rel_frontier T" "\x. x \ \\ \ g x = f x" + and contf: "continuous_on (\\) f" and fim: "f \ (\\) \ rel_frontier T" + obtains g where "continuous_on (\\) g" "g \ (\\) \ rel_frontier T" "\x. x \ \\ \ g x = f x" proof (cases "\ - \ = {}") case True show ?thesis - proof - show "continuous_on (\ \) f" - using True \\ \ \\ contf by auto - show "f ` \ \ \ rel_frontier T" - using True fim by auto - qed auto + using True assms(2) contf fim that by force next case False then have "0 \ aff_dim T" @@ -467,14 +454,14 @@ using Suc.IH [OF ple] by auto let ?Faces = "{D. \C \ \. D face_of C \ aff_dim D \ p}" have extendh: "\g. continuous_on D g \ - g ` D \ rel_frontier T \ + g \ D \ rel_frontier T \ (\x \ D \ \(\ \ {D. \C \ \. D face_of C \ aff_dim D < p}). g x = h x)" if D: "D \ \ \ ?Faces" for D proof (cases "D \ \(\ \ {D. \C \ \. D face_of C \ aff_dim D < p})") case True have "continuous_on D h" using True conth continuous_on_subset by blast - moreover have "h ` D \ rel_frontier T" + moreover have "h \ D \ rel_frontier T" using True him by blast ultimately show ?thesis by blast @@ -574,7 +561,7 @@ show ?thesis using that apply clarsimp - by (smt (verit, ccfv_SIG) IntI face_of_aff_dim_lt face_of_imp_convex [of X] face_of_imp_convex [of Y] face_of_trans ff) + by (smt (verit) IntI face_of_aff_dim_lt face_of_imp_convex face_of_trans ff inf_commute) qed obtain g where "continuous_on (\(\ \ ?Faces)) g" "g ` \(\ \ ?Faces) \ rel_frontier T" @@ -589,23 +576,20 @@ show "\(\ \ {D. \C\\. D face_of C \ aff_dim D < int i}) \ \\" using \\ \ \\ face_of_imp_subset by fastforce show "\\ \ \(\ \ {D. \C\\. D face_of C \ aff_dim D < i})" - proof (rule Union_mono) - show "\ \ \ \ {D. \C\\. D face_of C \ aff_dim D < int i}" - using face by (fastforce simp: aff i) - qed + using face by (intro Union_mono) (fastforce simp: aff i) qed have "int i \ aff_dim T" by (simp add: i) then show ?thesis - using extendf [of i] unfolding eq by (metis that) + using extendf [of i] that unfolding eq by fastforce qed lemma extend_map_lemma_cofinite0: assumes "finite \" and "pairwise (\S T. S \ T \ K) \" - and "\S. S \ \ \ \a g. a \ U \ continuous_on (S - {a}) g \ g ` (S - {a}) \ T \ (\x \ S \ K. g x = h x)" + and "\S. S \ \ \ \a g. a \ U \ continuous_on (S - {a}) g \ g \ (S - {a}) \ T \ (\x \ S \ K. g x = h x)" and "\S. S \ \ \ closed S" shows "\C g. finite C \ disjnt C U \ card C \ card \ \ - continuous_on (\\ - C) g \ g ` (\\ - C) \ T + continuous_on (\\ - C) g \ g \ (\\ - C) \ T \ (\x \ (\\ - C) \ K. g x = h x)" using assms proof induction @@ -614,18 +598,18 @@ next case (insert X \) then have "closed X" and clo: "\X. X \ \ \ closed X" - and \: "\S. S \ \ \ \a g. a \ U \ continuous_on (S - {a}) g \ g ` (S - {a}) \ T \ (\x \ S \ K. g x = h x)" + and \: "\S. S \ \ \ \a g. a \ U \ continuous_on (S - {a}) g \ g \ (S - {a}) \ T \ (\x \ S \ K. g x = h x)" and pwX: "\Y. Y \ \ \ Y \ X \ X \ Y \ K \ Y \ X \ K" and pwF: "pairwise (\ S T. S \ T \ K) \" by (simp_all add: pairwise_insert) obtain C g where C: "finite C" "disjnt C U" "card C \ card \" and contg: "continuous_on (\\ - C) g" - and gim: "g ` (\\ - C) \ T" + and gim: "g \ (\\ - C) \ T" and gh: "\x. x \ (\\ - C) \ K \ g x = h x" using insert.IH [OF pwF \ clo] by auto obtain a f where "a \ U" and contf: "continuous_on (X - {a}) f" - and fim: "f ` (X - {a}) \ T" + and fim: "f \ (X - {a}) \ T" and fh: "(\x \ X \ K. f x = h x)" using insert.prems by (meson insertI1) show ?case @@ -652,19 +636,19 @@ by (blast intro: continuous_on_subset) show "\x\(\(insert X \) - insert a C) \ K. (if x \ X then f x else g x) = h x" using gh by (auto simp: fh) - show "(\a. if a \ X then f a else g a) ` (\(insert X \) - insert a C) \ T" - using fim gim by auto force + show "(\a. if a \ X then f a else g a) \ (\(insert X \) - insert a C) \ T" + using fim gim Pi_iff by fastforce qed qed lemma extend_map_lemma_cofinite1: assumes "finite \" - and \: "\X. X \ \ \ \a g. a \ U \ continuous_on (X - {a}) g \ g ` (X - {a}) \ T \ (\x \ X \ K. g x = h x)" + and \: "\X. X \ \ \ \a g. a \ U \ continuous_on (X - {a}) g \ g \ (X - {a}) \ T \ (\x \ X \ K. g x = h x)" and clo: "\X. X \ \ \ closed X" and K: "\X Y. \X \ \; Y \ \; \ X \ Y; \ Y \ X\ \ X \ Y \ K" obtains C g where "finite C" "disjnt C U" "card C \ card \" "continuous_on (\\ - C) g" - "g ` (\\ - C) \ T" + "g \ (\\ - C) \ T" "\x. x \ (\\ - C) \ K \ g x = h x" proof - let ?\ = "{X \ \. \Y\\. \ X \ Y}" @@ -678,7 +662,7 @@ by (simp add: \finite \\ card_mono) moreover obtain C g where "finite C \ disjnt C U \ card C \ card ?\ \ - continuous_on (\?\ - C) g \ g ` (\?\ - C) \ T + continuous_on (\?\ - C) g \ g \ (\?\ - C) \ T \ (\x \ (\?\ - C) \ K. g x = h x)" using extend_map_lemma_cofinite0 [OF fin pw, of U T h] by (fastforce intro!: clo \) ultimately show ?thesis @@ -689,12 +673,12 @@ lemma extend_map_lemma_cofinite: assumes "finite \" "\ \ \" and T: "convex T" "bounded T" and poly: "\X. X \ \ \ polytope X" - and contf: "continuous_on (\\) f" and fim: "f ` (\\) \ rel_frontier T" + and contf: "continuous_on (\\) f" and fim: "f \ (\\) \ rel_frontier T" and face: "\X Y. \X \ \; Y \ \\ \ (X \ Y) face_of X" and aff: "\X. X \ \ - \ \ aff_dim X \ aff_dim T" obtains C g where "finite C" "disjnt C (\\)" "card C \ card \" "continuous_on (\\ - C) g" - "g ` (\ \ - C) \ rel_frontier T" "\x. x \ \\ \ g x = f x" + "g \ (\ \ - C) \ rel_frontier T" "\x. x \ \\ \ g x = f x" proof - define \ where "\ \ \ \ {D. \C \ \ - \. D face_of C \ aff_dim D < aff_dim T}" have "finite \" @@ -707,7 +691,7 @@ by (metis face inf_commute) have *: "\X Y. \X \ \; Y \ \\ \ X \ Y face_of X" by (simp add: \_def) (smt (verit) \\ \ \\ DiffE face' face_of_Int_subface in_mono inf.idem) - obtain h where conth: "continuous_on (\\) h" and him: "h ` (\\) \ rel_frontier T" + obtain h where conth: "continuous_on (\\) h" and him: "h \ (\\) \ rel_frontier T" and hf: "\x. x \ \\ \ h x = f x" proof (rule extend_map_lemma [OF \finite \\ [unfolded \_def] Un_upper1 T]) show "\X. \X \ \ \ {D. \C\\ - \. D face_of C \ aff_dim D < aff_dim T}\ \ polytope X" @@ -720,11 +704,11 @@ then obtain a where a: "a \ \\" by blast have \: "\a g. a \ \\ \ continuous_on (D - {a}) g \ - g ` (D - {a}) \ rel_frontier T \ (\x \ D \ \\. g x = h x)" + g \ (D - {a}) \ rel_frontier T \ (\x \ D \ \\. g x = h x)" if "D \ \" for D proof (cases "D \ \\") case True - then have "h ` (D - {a}) \ rel_frontier T" "continuous_on (D - {a}) h" + then have "h \ (D - {a}) \ rel_frontier T" "continuous_on (D - {a}) h" using him by (blast intro!: \a \ \\\ continuous_on_subset [OF conth])+ then show ?thesis using a by blast @@ -755,7 +739,7 @@ by (simp add: rel_frontier_retract_of_punctured_affine_hull poly polytope_imp_bounded polytope_imp_convex that brelD) then obtain r where relfD: "rel_frontier D \ affine hull D - {b}" and contr: "continuous_on (affine hull D - {b}) r" - and rim: "r ` (affine hull D - {b}) \ rel_frontier D" + and rim: "r \ (affine hull D - {b}) \ rel_frontier D" and rid: "\x. x \ rel_frontier D \ r x = x" by (auto simp: retract_of_def retraction_def) show ?thesis @@ -774,7 +758,7 @@ have "r ` (D - {b}) \ r ` (affine hull D - {b})" by (simp add: Diff_mono hull_subset image_mono) also have "... \ rel_frontier D" - by (rule rim) + using rim by auto also have "... \ \{E. E face_of D \ aff_dim E < aff_dim T}" using affD by (force simp: rel_frontier_of_polyhedron [OF \polyhedron D\] facet_of_def) @@ -788,7 +772,7 @@ show "continuous_on (r ` (D - {b})) h" by (simp add: Diff_mono hull_subset continuous_on_subset [OF conth rsub]) qed - show "(h \ r) ` (D - {b}) \ rel_frontier T" + show "(h \ r) \ (D - {b}) \ rel_frontier T" using brelD him rsub by fastforce show "(h \ r) x = h x" if x: "x \ D \ \\" for x proof - @@ -825,7 +809,7 @@ have clo: "\S. S \ \ \ closed S" by (simp add: poly polytope_imp_closed) obtain C g where "finite C" "disjnt C (\\)" "card C \ card \" "continuous_on (\\ - C) g" - "g ` (\\ - C) \ rel_frontier T" + "g \ (\\ - C) \ rel_frontier T" and gh: "\x. x \ (\\ - C) \ \\ \ g x = h x" proof (rule extend_map_lemma_cofinite1 [OF \finite \\ \ clo]) show "X \ Y \ \\" if XY: "X \ \" "Y \ \" and "\ X \ Y" "\ Y \ X" for X Y @@ -856,7 +840,7 @@ and face: "\X Y. \X \ \; Y \ \\ \ (X \ Y) face_of X" and contf: "continuous_on S f" and fim: "f \ S \ rel_frontier T" obtains g where "continuous_on (\\) g" - "g ` (\\) \ rel_frontier T" "\x. x \ S \ g x = f x" + "g \ (\\) \ rel_frontier T" "\x. x \ S \ g x = f x" proof - obtain V g where "S \ V" "open V" "continuous_on V g" and gim: "g \ V \ rel_frontier T" and gf: "\x. x \ S \ g x = f x" using neighbourhood_extension_into_ANR [OF contf fim _ \closed S\] ANR_rel_frontier_convex T by blast @@ -877,12 +861,12 @@ proof (rule extend_map_lemma [of \ "\ \ Pow V" T g]) show "continuous_on (\(\ \ Pow V)) g" by (metis Union_Int_subset Union_Pow_eq \continuous_on V g\ continuous_on_subset le_inf_iff) - qed (use \finite \\ T polyG affG faceG gim in fastforce)+ + qed (use \finite \\ T polyG affG faceG gim image_subset_iff_funcset in auto) show ?thesis proof show "continuous_on (\\) h" using \\\ = \\\ conth by auto - show "h ` \\ \ rel_frontier T" + show "h \ \\ \ rel_frontier T" using \\\ = \\\ him by auto show "h x = f x" if "x \ S" for x proof - @@ -910,7 +894,7 @@ and face: "\X Y. \X \ \; Y \ \\ \ (X \ Y) face_of X" and contf: "continuous_on S f" and fim: "f \ S \ rel_frontier T" obtains C g where "finite C" "disjnt C S" "continuous_on (\\ - C) g" - "g ` (\\ - C) \ rel_frontier T" "\x. x \ S \ g x = f x" + "g \ (\\ - C) \ rel_frontier T" "\x. x \ S \ g x = f x" proof - obtain V g where "S \ V" "open V" "continuous_on V g" and gim: "g \ V \ rel_frontier T" and gf: "\x. x \ S \ g x = f x" using neighbourhood_extension_into_ANR [OF contf fim _ \closed S\] ANR_rel_frontier_convex T by blast @@ -926,15 +910,15 @@ by (rule cell_complex_subdivision_exists [OF \d>0\ \finite \\ poly aff face]) auto obtain C h where "finite C" and dis: "disjnt C (\(\ \ Pow V))" and card: "card C \ card \" and conth: "continuous_on (\\ - C) h" - and him: "h ` (\\ - C) \ rel_frontier T" + and him: "h \ (\\ - C) \ rel_frontier T" and hg: "\x. x \ \(\ \ Pow V) \ h x = g x" proof (rule extend_map_lemma_cofinite [of \ "\ \ Pow V" T g]) show "continuous_on (\(\ \ Pow V)) g" by (metis Union_Int_subset Union_Pow_eq \continuous_on V g\ continuous_on_subset le_inf_iff) - show "g ` \(\ \ Pow V) \ rel_frontier T" + show "g \ \(\ \ Pow V) \ rel_frontier T" using gim by force qed (auto intro: \finite \\ T polyG affG dest: faceG) - have Ssub: "S \ \(\ \ Pow V)" + have "S \ \(\ \ Pow V)" proof fix x assume "x \ S" @@ -948,23 +932,8 @@ then show "x \ \(\ \ Pow V)" using \X \ \\ \x \ X\ by blast qed - show ?thesis - proof - show "continuous_on (\\-C) h" - using \\\ = \\\ conth by auto - show "h ` (\\ - C) \ rel_frontier T" - using \\\ = \\\ him by auto - show "h x = f x" if "x \ S" for x - proof - - have "h x = g x" - using Ssub hg that by blast - also have "... = f x" - by (simp add: gf that) - finally show "h x = f x" . - qed - show "disjnt C S" - using dis Ssub by (meson disjnt_iff subset_eq) - qed (intro \finite C\) + then show ?thesis + by (metis PowI Union_Pow_eq \\ \ = \ \\ \finite C\ conth dis disjnt_Union2 gf hg him subsetD that) qed @@ -1021,7 +990,7 @@ by (metis aff aff_dim_subset inf_commute inf_le1 order_trans) obtain K g where K: "finite K" "disjnt K S" and contg: "continuous_on (\{bbox \ T} - K) g" - and gim: "g ` (\{bbox \ T} - K) \ rel_frontier U" + and gim: "g \ (\{bbox \ T} - K) \ rel_frontier U" and gf: "\x. x \ S \ g x = f x" proof (rule extend_map_cell_complex_to_sphere_cofinite [OF _ Ssub _ \convex U\ \bounded U\ _ _ _ contf fim]) @@ -1090,7 +1059,7 @@ have "(g \ closest_point (cbox (- c) c \ T)) ` (T - K) \ g ` (\{bbox \ T} - K)" by (metis image_comp image_mono cpt_subset) also have "... \ rel_frontier U" - by (rule gim) + using gim by blast finally show "(g \ closest_point (cbox (- c) c \ T)) \ (T - K) \ rel_frontier U" by blast show "(g \ closest_point (cbox (- c) c \ T)) x = f x" if "x \ S" for x @@ -1112,7 +1081,7 @@ order_trans [OF \S \ T\ hull_subset [of T affine]]) then obtain K g where "finite K" "disjnt K S" and contg: "continuous_on (T - K) g" - and gim: "g ` (T - K) \ rel_frontier U" + and gim: "g \ (T - K) \ rel_frontier U" and gf: "\x. x \ S \ g x = f x" by (rule_tac K=K and g=g in that) (auto simp: hull_inc elim: continuous_on_subset) then show ?thesis @@ -1195,7 +1164,7 @@ ultimately have "frontier (cball a d) \ U retract_of (U - {a})" by metis then obtain r where contr: "continuous_on (U - {a}) r" - and rim: "r ` (U - {a}) \ sphere a d" "r ` (U - {a}) \ U" + and rim: "r \ (U - {a}) \ sphere a d" "r \ (U - {a}) \ U" and req: "\x. x \ sphere a d \ U \ r x = x" using \affine U\ by (force simp: retract_of_def retraction_def hull_same) define j where "j \ \x. if x \ ball a d then r x else x" @@ -1212,8 +1181,7 @@ using rim by auto then show "j y \ S \ C - ball a d" unfolding j_def - using \r y \ sphere a d\ \y \ U - {a}\ \y \ S \ (C - {a})\ d rim - by (metis Diff_iff Int_iff Un_iff subsetD cball_diff_eq_sphere image_subset_iff) + using \y \ S \ (C - {a})\ \y \ U - {a}\ d rim(2) by auto qed have contj: "continuous_on (U - {a}) j" unfolding j_def Uaeq @@ -1437,7 +1405,7 @@ and gim: "g \ (T - K) \ rel_frontier U" and gf: "\x. x \ S \ g x = f x" using assms extend_map_affine_to_sphere_cofinite_simple by metis - have "(\y C. C \ components (T - S) \ x \ C \ y \ C \ y \ L)" if "x \ K" for x + have "\y C. C \ components (T - S) \ x \ C \ y \ C \ y \ L" if "x \ K" for x proof - have "x \ T-S" using \K \ T\ \disjnt K S\ disjnt_def that by fastforce @@ -1446,7 +1414,7 @@ with ovlap [of C] show ?thesis by blast qed - then obtain \ where \: "\x. x \ K \ \C. C \ components (T - S) \ x \ C \ \ x \ C \ \ x \ L" + then obtain \ where \: "\x. x \ K \ \C. C \ components (T - S) \ x \ C \ \ x \ C \ \ x \ L" by metis obtain h where conth: "continuous_on (T - \ ` K) h" and him: "h \ (T - \ ` K) \ rel_frontier U" @@ -1525,7 +1493,7 @@ define LU where "LU \ L \ (\ {C \ components (T - S). \bounded C} - cbox (-(b+One)) (b+One))" obtain K g where "finite K" "K \ LU" "K \ T" "disjnt K S" and contg: "continuous_on (T - K) g" - and gim: "g ` (T - K) \ rel_frontier U" + and gim: "g \ (T - K) \ rel_frontier U" and gf: "\x. x \ S \ g x = f x" proof (rule extend_map_affine_to_sphere2 [OF SUT aff contf fim]) show "C \ LU \ {}" if "C \ components (T - S)" for C @@ -1577,7 +1545,7 @@ proof (cases "x \ cbox (- c) c") case True with \x \ T\ show ?thesis - using cbsub(3) Knot by (force simp: closest_point_self) + using cbsub(3) Knot by (force simp: closest_point_self) next case False have clo_in_rf: "closest_point (cbox (- c) c \ T) x \ rel_frontier (cbox (- c) c \ T)" @@ -1617,7 +1585,7 @@ by (intro continuous_on_compose continuous_on_closest_point continuous_on_subset [OF contg]; force) have "g (closest_point (cbox (- c) c \ T) x) \ rel_frontier U" if "x \ T" "x \ K \ x \ cbox (- b - One) (b + One)" for x - using gim [THEN subsetD] that cloTK by blast + using cloTK gim that by auto then show "(g \ closest_point (cbox (- c) c \ T)) \ (T - K \ cbox (- (b + One)) (b + One)) \ rel_frontier U" by force @@ -1663,8 +1631,7 @@ and "\C. \C \ components(- S); bounded C\ \ C \ L \ {}" obtains K g where "finite K" "K \ L" "disjnt K S" "continuous_on (- K) g" "g \ (- K) \ sphere a r" "\x. x \ S \ g x = f x" - using extend_map_affine_to_sphere_cofinite - [OF \compact S\ affine_UNIV subset_UNIV] assms + using assms extend_map_affine_to_sphere_cofinite [OF \compact S\ affine_UNIV subset_UNIV] by (metis Compl_eq_Diff_UNIV aff_dim_UNIV of_nat_le_iff) corollary extend_map_UNIV_to_sphere_no_bounded_component: @@ -1789,14 +1756,7 @@ by auto moreover have "connected (- S) = connected (- sphere a r)" - proof (rule homotopy_eqv_separation) - show "S homotopy_eqv sphere a r" - using hom homeomorphic_imp_homotopy_eqv by blast - show "compact (sphere a r)" - by simp - then show " compact S" - using hom homeomorphic_compactness by blast - qed + by (meson hom compact_sphere homeomorphic_compactness homeomorphic_imp_homotopy_eqv homotopy_eqv_separation) ultimately show ?thesis using connected_Int_frontier [of "- sphere a r" "ball a r"] by (auto simp: \0 < r\) qed @@ -1831,7 +1791,7 @@ using S by (auto simp: homeomorphic_def) show "connected (- T)" if "closed T" "T \ S" for T proof - - have "f ` T \ sphere a r" + have "f \ T \ sphere a r" using \T \ S\ hom homeomorphism_image1 by blast moreover have "f ` T \ sphere a r" using \T \ S\ hom @@ -1844,7 +1804,7 @@ moreover then have "compact (f ` T)" by (meson compact_continuous_image continuous_on_subset hom homeomorphism_def psubsetE \T \ S\) moreover have "T homotopy_eqv f ` T" - by (meson \f ` T \ sphere a r\ dual_order.strict_implies_order hom homeomorphic_def homeomorphic_imp_homotopy_eqv homeomorphism_of_subsets \T \ S\) + by (meson hom homeomorphic_def homeomorphic_imp_homotopy_eqv homeomorphism_of_subsets order.refl psubsetE that(2)) ultimately show ?thesis using homotopy_eqv_separation [of T "f`T"] by blast qed @@ -1986,7 +1946,7 @@ lemma inv_of_domain_ss0: fixes f :: "'a \ 'a::euclidean_space" - assumes contf: "continuous_on U f" and injf: "inj_on f U" and fim: "f ` U \ S" + assumes contf: "continuous_on U f" and injf: "inj_on f U" and fim: "f \ U \ S" and "subspace S" and dimS: "dim S = DIM('b::euclidean_space)" and ope: "openin (top_of_set S) U" shows "openin (top_of_set S) (f ` U)" @@ -2019,19 +1979,20 @@ show "open (k ` U)" by (simp add: ope_iff homeomorphism_imp_open_map [OF homkh ope]) show "inj_on (k \ f \ h) (k ` U)" - by (smt (verit) comp_apply inj_on_def \U \ S\ fim homeomorphism_apply2 homhk image_iff injf subsetD) + unfolding inj_on_def + by (smt (verit, ccfv_threshold) PiE \U \ S\ assms(3) comp_apply homeomorphism_def homhk imageE inj_on_def injf subset_eq) qed moreover have eq: "f ` U = h ` (k \ f \ h \ k) ` U" unfolding image_comp [symmetric] using \U \ S\ fim - by (metis homeomorphism_image2 homeomorphism_of_subsets homkh subset_image_iff) + by (metis homeomorphism_image2 homeomorphism_of_subsets homhk homkh image_subset_iff_funcset top_greatest) ultimately show ?thesis by (metis (no_types, opaque_lifting) homeomorphism_imp_open_map homhk image_comp open_openin subtopology_UNIV) qed lemma inv_of_domain_ss1: fixes f :: "'a \ 'a::euclidean_space" - assumes contf: "continuous_on U f" and injf: "inj_on f U" and fim: "f ` U \ S" + assumes contf: "continuous_on U f" and injf: "inj_on f U" and fim: "f \ U \ S" and "subspace S" and ope: "openin (top_of_set S) U" shows "openin (top_of_set S) (f ` U)" @@ -2045,7 +2006,7 @@ show "continuous_on (U \ S') g" unfolding g_def by (auto intro!: continuous_intros continuous_on_compose2 [OF contf continuous_on_fst]) - show "g ` (U \ S') \ S \ S'" + show "g \ (U \ S') \ S \ S'" using fim by (auto simp: g_def) show "inj_on g (U \ S')" using injf by (auto simp: g_def inj_on_def) @@ -2073,7 +2034,7 @@ fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes ope: "openin (top_of_set U) S" and "subspace U" "subspace V" and VU: "dim V \ dim U" - and contf: "continuous_on S f" and fim: "f ` S \ V" + and contf: "continuous_on S f" and fim: "f \ S \ V" and injf: "inj_on f S" shows "openin (top_of_set V) (f ` S)" proof - @@ -2087,7 +2048,7 @@ have eq: "f ` S = k ` (h \ f) ` S" proof - have "k ` h ` f ` S = f ` S" - by (meson fim homeomorphism_def homeomorphism_of_subsets homhk subset_refl) + by (meson equalityD2 fim funcset_image homeomorphism_image2 homeomorphism_of_subsets homhk) then show ?thesis by (simp add: image_comp) qed @@ -2101,11 +2062,11 @@ moreover have "openin (top_of_set U) ((h \ f) ` S)" proof (rule inv_of_domain_ss1) show "continuous_on S (h \ f)" - by (meson contf continuous_on_compose continuous_on_subset fim homeomorphism_cont1 homhk) + by (meson contf continuous_on_compose continuous_on_subset fim funcset_image homeomorphism_cont2 homkh) show "inj_on (h \ f) S" - by (smt (verit, ccfv_SIG) comp_apply fim inj_on_def homeomorphism_apply2 [OF homkh] image_subset_iff injf) - show "(h \ f) ` S \ U" - using \V' \ U\ hfV' by auto + by (smt (verit, ccfv_SIG) Pi_iff comp_apply fim homeomorphism_apply2 homkh inj_on_def injf) + show "h \ f \ S \ U" + using \V' \ U\ hfV' by blast qed (auto simp: assms) ultimately show "openin (top_of_set V') ((h \ f) ` S)" using openin_subset_trans \V' \ U\ by force @@ -2116,7 +2077,7 @@ fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes ope: "openin (top_of_set U) S" and "subspace U" "subspace V" - and contf: "continuous_on S f" and fim: "f ` S \ V" + and contf: "continuous_on S f" and fim: "f \ S \ V" and injf: "inj_on f S" and "S \ {}" shows "dim U \ dim V" proof - @@ -2130,11 +2091,12 @@ then obtain h k where homhk: "homeomorphism V T h k" using homeomorphic_def by blast have "continuous_on S (h \ f)" - by (meson contf continuous_on_compose continuous_on_subset fim homeomorphism_cont1 homhk) + by (meson contf continuous_on_compose continuous_on_subset fim homeomorphism_def homhk image_subset_iff_funcset) moreover have "(h \ f) ` S \ U" using \T \ U\ fim homeomorphism_image1 homhk by fastforce moreover have "inj_on (h \ f) S" - by (smt (verit, best) comp_apply inj_on_def fim homeomorphism_apply1 homhk image_subset_iff injf) + unfolding inj_on_def + by (metis Pi_iff comp_apply fim homeomorphism_def homhk inj_on_def injf) ultimately have ope_hf: "openin (top_of_set U) ((h \ f) ` S)" using invariance_of_domain_subspaces [OF ope \subspace U\ \subspace U\] by blast have "(h \ f) ` S \ T" @@ -2155,7 +2117,7 @@ fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes ope: "openin (top_of_set U) S" and aff: "affine U" "affine V" "aff_dim V \ aff_dim U" - and contf: "continuous_on S f" and fim: "f ` S \ V" + and contf: "continuous_on S f" and fim: "f \ S \ V" and injf: "inj_on f S" shows "openin (top_of_set V) (f ` S)" proof (cases "S = {}") @@ -2177,7 +2139,7 @@ by (metis \a \ U\ \b \ V\ aff_dim_eq_dim affine_hull_eq aff of_nat_le_iff) show "continuous_on ((+) (- a) ` S) ((+) (- b) \ f \ (+) a)" by (metis contf continuous_on_compose homeomorphism_cont2 homeomorphism_translation translation_galois) - show "((+) (- b) \ f \ (+) a) ` (+) (- a) ` S \ (+) (- b) ` V" + show "(+) (- b) \ f \ (+) a \ (+) (- a) ` S \ (+) (- b) ` V" using fim by auto show "inj_on ((+) (- b) \ f \ (+) a) ((+) (- a) ` S)" by (auto simp: inj_on_def) (meson inj_onD injf) @@ -2190,7 +2152,7 @@ fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes ope: "openin (top_of_set U) S" and aff: "affine U" "affine V" - and contf: "continuous_on S f" and fim: "f ` S \ V" + and contf: "continuous_on S f" and fim: "f \ S \ V" and injf: "inj_on f S" and "S \ {}" shows "aff_dim U \ aff_dim V" proof - @@ -2206,7 +2168,7 @@ by (simp add: \b \ V\ affine_diffs_subspace_subtract \affine V\ cong: image_cong_simp) show "continuous_on ((+) (- a) ` S) ((+) (- b) \ f \ (+) a)" by (metis contf continuous_on_compose homeomorphism_cont2 homeomorphism_translation translation_galois) - show "((+) (- b) \ f \ (+) a) ` (+) (- a) ` S \ (+) (- b) ` V" + show "(+) (- b) \ f \ (+) a \ (+) (- a) ` S \ (+) (- b) ` V" using fim by auto show "inj_on ((+) (- b) \ f \ (+) a) ((+) (- a) ` S)" by (auto simp: inj_on_def) (meson inj_onD injf) @@ -2227,7 +2189,7 @@ corollary continuous_injective_image_subspace_dim_le: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "subspace S" "subspace T" - and contf: "continuous_on S f" and fim: "f ` S \ T" + and contf: "continuous_on S f" and fim: "f \ S \ T" and injf: "inj_on f S" shows "dim S \ dim T" using invariance_of_dimension_subspaces [of S S _ f] assms by (auto simp: subspace_affine) @@ -2235,7 +2197,7 @@ lemma invariance_of_dimension_convex_domain: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "convex S" - and contf: "continuous_on S f" and fim: "f ` S \ affine hull T" + and contf: "continuous_on S f" and fim: "f \ S \ affine hull T" and injf: "inj_on f S" shows "aff_dim S \ aff_dim T" proof (cases "S = {}") @@ -2249,7 +2211,7 @@ by (simp add: openin_rel_interior) show "continuous_on (rel_interior S) f" using contf continuous_on_subset rel_interior_subset by blast - show "f ` rel_interior S \ affine hull T" + show "f \ rel_interior S \ affine hull T" using fim rel_interior_subset by blast show "inj_on f (rel_interior S)" using inj_on_subset injf rel_interior_subset by blast @@ -2271,8 +2233,8 @@ proof (rule invariance_of_dimension_convex_domain [OF \convex S\]) show "continuous_on S h" using homeomorphism_def homhk by blast - show "h ` S \ affine hull T" - by (metis homeomorphism_def homhk hull_subset) + show "h \ S \ affine hull T" + using homeomorphism_image1 homhk hull_subset by fastforce show "inj_on h S" by (meson homeomorphism_apply1 homhk inj_on_inverseI) qed @@ -2342,13 +2304,13 @@ lemma continuous_image_subset_interior: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "continuous_on S f" "inj_on f S" "DIM('b) \ DIM('a)" - shows "f ` (interior S) \ interior(f ` S)" + shows "f \ (interior S) \ interior(f ` S)" proof - have "open (f ` interior S)" using assms by (intro invariance_of_domain_gen) (auto simp: subset_inj_on interior_subset continuous_on_subset) then show ?thesis - by (simp add: image_mono interior_maximal interior_subset) + by (simp add: image_mono interiorI interior_subset) qed lemma homeomorphic_interiors_same_dimension: @@ -2363,9 +2325,9 @@ and contf: "continuous_on S f" and contg: "continuous_on T g" then have fST: "f ` S = T" and gTS: "g ` T = S" and "inj_on f S" "inj_on g T" by (auto simp: inj_on_def intro: rev_image_eqI) metis+ - have fim: "f ` interior S \ interior T" + have fim: "f \ interior S \ interior T" using continuous_image_subset_interior [OF contf \inj_on f S\] dimeq fST by simp - have gim: "g ` interior T \ interior S" + have gim: "g \ interior T \ interior S" using continuous_image_subset_interior [OF contg \inj_on g T\] dimeq gTS by simp show "homeomorphism (interior S) (interior T) f g" unfolding homeomorphism_def @@ -2437,16 +2399,14 @@ and contf: "continuous_on S f" and contg: "continuous_on T g" then have fST: "f ` S = T" and gTS: "g ` T = S" and "inj_on f S" "inj_on g T" by (auto simp: inj_on_def intro: rev_image_eqI) metis+ - have "g ` interior T \ interior S" + have "g \ interior T \ interior S" using continuous_image_subset_interior [OF contg \inj_on g T\] dimeq gTS by simp then have fim: "f ` frontier S \ frontier T" - unfolding frontier_def - using continuous_image_subset_interior assms(2) assms(3) S by auto - have "f ` interior S \ interior T" + unfolding frontier_def using Pi_mem S assms by fastforce + have "f \ interior S \ interior T" using continuous_image_subset_interior [OF contf \inj_on f S\] dimeq fST by simp then have gim: "g ` frontier T \ frontier S" - unfolding frontier_def - using continuous_image_subset_interior T assms(2) assms(3) by auto + unfolding frontier_def using Pi_mem T assms by fastforce show "homeomorphism (frontier S) (frontier T) f g" unfolding homeomorphism_def proof (intro conjI ballI) @@ -2500,9 +2460,10 @@ lemma continuous_image_subset_rel_interior: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f ` S \ T" + assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f \ S \ T" and TS: "aff_dim T \ aff_dim S" - shows "f ` (rel_interior S) \ rel_interior(f ` S)" + shows "f \ (rel_interior S) \ rel_interior(f ` S)" +unfolding image_subset_iff_funcset [symmetric] proof (rule rel_interior_maximal) show "f ` rel_interior S \ f ` S" by(simp add: image_mono rel_interior_subset) @@ -2511,9 +2472,9 @@ show "openin (top_of_set (affine hull S)) (rel_interior S)" by (simp add: openin_rel_interior) show "aff_dim (affine hull f ` S) \ aff_dim (affine hull S)" - by (metis aff_dim_affine_hull aff_dim_subset fim TS order_trans) - show "f ` rel_interior S \ affine hull f ` S" - by (meson \f ` rel_interior S \ f ` S\ hull_subset order_trans) + by (metis TS aff_dim_affine_hull aff_dim_subset fim image_subset_iff_funcset order_trans) + show "f \ rel_interior S \ affine hull f ` S" + using \f ` rel_interior S \ f ` S\ hull_subset by fastforce show "continuous_on (rel_interior S) f" using contf continuous_on_subset rel_interior_subset by blast show "inj_on f (rel_interior S)" @@ -2533,10 +2494,10 @@ and contf: "continuous_on S f" and contg: "continuous_on T g" then have fST: "f ` S = T" and gTS: "g ` T = S" and "inj_on f S" "inj_on g T" by (auto simp: inj_on_def intro: rev_image_eqI) metis+ - have fim: "f ` rel_interior S \ rel_interior T" - by (metis \inj_on f S\ aff contf continuous_image_subset_rel_interior fST order_refl) - have gim: "g ` rel_interior T \ rel_interior S" - by (metis \inj_on g T\ aff contg continuous_image_subset_rel_interior gTS order_refl) + have fim: "f \ rel_interior S \ rel_interior T" + by (smt (verit, best) PiE Pi_I S \inj_on f S\ aff contf continuous_image_subset_rel_interior fST) + have gim: "g \ rel_interior T \ rel_interior S" + by (metis T \inj_on g T\ aff contg continuous_image_subset_rel_interior dual_order.refl funcsetI gTS) show "homeomorphism (rel_interior S) (rel_interior T) f g" unfolding homeomorphism_def proof (intro conjI ballI) @@ -2553,7 +2514,7 @@ by (metis fg \x \ rel_interior T\ imageI) qed moreover have "f ` rel_interior S \ rel_interior T" - by (metis \inj_on f S\ aff contf continuous_image_subset_rel_interior fST order_refl) + using fim by blast ultimately show "f ` rel_interior S = rel_interior T" by blast show "continuous_on (rel_interior S) f" @@ -2587,8 +2548,8 @@ proof (rule invariance_of_dimension_affine_sets) show "continuous_on (rel_interior S) f" using contf continuous_on_subset rel_interior_subset by blast - show "f ` rel_interior S \ affine hull T" - by (meson S hull_subset image_subsetI rel_interior_subset rev_subsetD) + show "f \ rel_interior S \ affine hull T" + by (simp add: S hull_inc mem_rel_interior_ball) show "inj_on f (rel_interior S)" by (metis S inj_on_inverseI inj_on_subset rel_interior_subset) qed (simp_all add: openin_rel_interior assms) @@ -2625,10 +2586,10 @@ and contf: "continuous_on S f" and contg: "continuous_on T g" then have fST: "f ` S = T" and gTS: "g ` T = S" and "inj_on f S" "inj_on g T" by (auto simp: inj_on_def intro: rev_image_eqI) metis+ - have fim: "f ` rel_interior S \ rel_interior T" - by (metis \inj_on f S\ aff contf continuous_image_subset_rel_interior fST order_refl) - have gim: "g ` rel_interior T \ rel_interior S" - by (metis \inj_on g T\ aff contg continuous_image_subset_rel_interior gTS order_refl) + have fim: "f \ rel_interior S \ rel_interior T" + by (metis \inj_on f S\ aff contf continuous_image_subset_rel_interior dual_order.refl fST image_subset_iff_funcset) + have gim: "g \ rel_interior T \ rel_interior S" + by (metis \inj_on g T\ aff contg continuous_image_subset_rel_interior dual_order.refl gTS image_subset_iff_funcset) show "homeomorphism (S - rel_interior S) (T - rel_interior T) f g" unfolding homeomorphism_def proof (intro conjI ballI) @@ -2637,11 +2598,11 @@ show fg: "\y. y \ T - rel_interior T \ f (g y) = y" using T mem_rel_interior_ball by blast show "f ` (S - rel_interior S) = T - rel_interior T" - using S fST fim gim by auto + using S fST fim gim image_subset_iff_funcset by fastforce show "continuous_on (S - rel_interior S) f" using contf continuous_on_subset rel_interior_subset by blast show "g ` (T - rel_interior T) = S - rel_interior S" - using T gTS gim fim by auto + using T gTS gim fim image_subset_iff_funcset by fastforce show "continuous_on (T - rel_interior T) g" using contg continuous_on_subset rel_interior_subset by blast qed @@ -2744,7 +2705,7 @@ (q \ (\z. (Arg2pi z / (2 * pi))))" proof - obtain h where conth: "continuous_on ({0..1::real} \ {0..1}) h" - and him: "h ` ({0..1} \ {0..1}) \ S" + and him: "h \ ({0..1} \ {0..1}) \ S" and h0: "(\x. h (0, x) = p x)" and h1: "(\x. h (1, x) = q x)" and h01: "(\t\{0..1}. h (t, 1) = h (t, 0)) " @@ -2795,13 +2756,13 @@ lemma simply_connected_eq_homotopic_circlemaps1: fixes f :: "complex \ 'a::topological_space" and g :: "complex \ 'a" assumes S: "simply_connected S" - and contf: "continuous_on (sphere 0 1) f" and fim: "f ` (sphere 0 1) \ S" - and contg: "continuous_on (sphere 0 1) g" and gim: "g ` (sphere 0 1) \ S" + and contf: "continuous_on (sphere 0 1) f" and fim: "f \ (sphere 0 1) \ S" + and contg: "continuous_on (sphere 0 1) g" and gim: "g \ (sphere 0 1) \ S" shows "homotopic_with_canon (\h. True) (sphere 0 1) S f g" proof - let ?h = "(\t. complex_of_real (2 * pi * t) * \)" have "homotopic_loops S (f \ exp \ ?h) (f \ exp \ ?h) \ homotopic_loops S (g \ exp \ ?h) (g \ exp \ ?h)" - by (simp add: homotopic_circlemaps_imp_homotopic_loops contf fim contg gim) + by (simp add: homotopic_circlemaps_imp_homotopic_loops contf fim contg gim image_subset_iff_funcset) then have "homotopic_loops S (f \ exp \ ?h) (g \ exp \ ?h)" using S simply_connected_homotopic_loops by blast then show ?thesis @@ -2812,19 +2773,19 @@ lemma simply_connected_eq_homotopic_circlemaps2a: fixes h :: "complex \ 'a::topological_space" - assumes conth: "continuous_on (sphere 0 1) h" and him: "h ` (sphere 0 1) \ S" + assumes conth: "continuous_on (sphere 0 1) h" and him: "h \ sphere 0 1 \ S" and hom: "\f g::complex \ 'a. - \continuous_on (sphere 0 1) f; f ` (sphere 0 1) \ S; - continuous_on (sphere 0 1) g; g ` (sphere 0 1) \ S\ + \continuous_on (sphere 0 1) f; f \ (sphere 0 1) \ S; + continuous_on (sphere 0 1) g; g \ (sphere 0 1) \ S\ \ homotopic_with_canon (\h. True) (sphere 0 1) S f g" shows "\a. homotopic_with_canon (\h. True) (sphere 0 1) S h (\x. a)" - by (metis conth continuous_on_const him hom image_subset_iff) + by (metis conth continuous_on_const him hom image_subset_iff image_subset_iff_funcset) lemma simply_connected_eq_homotopic_circlemaps2b: fixes S :: "'a::real_normed_vector set" assumes "\f g::complex \ 'a. - \continuous_on (sphere 0 1) f; f ` (sphere 0 1) \ S; - continuous_on (sphere 0 1) g; g ` (sphere 0 1) \ S\ + \continuous_on (sphere 0 1) f; f \ (sphere 0 1) \ S; + continuous_on (sphere 0 1) g; g \ (sphere 0 1) \ S\ \ homotopic_with_canon (\h. True) (sphere 0 1) S f g" shows "path_connected S" proof (clarsimp simp add: path_connected_eq_homotopic_points) @@ -2869,10 +2830,10 @@ fixes S :: "'a::real_normed_vector set" shows "simply_connected S \ (\f g::complex \ 'a. - continuous_on (sphere 0 1) f \ f ` (sphere 0 1) \ S \ - continuous_on (sphere 0 1) g \ g ` (sphere 0 1) \ S + continuous_on (sphere 0 1) f \ f \ (sphere 0 1) \ S \ + continuous_on (sphere 0 1) g \ g \ (sphere 0 1) \ S \ homotopic_with_canon (\h. True) (sphere 0 1) S f g)" - by (metis simply_connected_eq_homotopic_circlemaps1 simply_connected_eq_homotopic_circlemaps2a + by (metis image_subset_iff_funcset simply_connected_eq_homotopic_circlemaps1 simply_connected_eq_homotopic_circlemaps2a simply_connected_eq_homotopic_circlemaps2b simply_connected_eq_homotopic_circlemaps3) proposition simply_connected_eq_contractible_circlemap: @@ -2882,7 +2843,7 @@ (\f::complex \ 'a. continuous_on (sphere 0 1) f \ f `(sphere 0 1) \ S \ (\a. homotopic_with_canon (\h. True) (sphere 0 1) S f (\x. a)))" - by (metis simply_connected_eq_homotopic_circlemaps simply_connected_eq_homotopic_circlemaps2a + by (metis image_subset_iff_funcset simply_connected_eq_homotopic_circlemaps simply_connected_eq_homotopic_circlemaps2a simply_connected_eq_homotopic_circlemaps3 simply_connected_imp_path_connected) corollary homotopy_eqv_simple_connectedness: @@ -2966,12 +2927,7 @@ then obtain f g where hom: "homeomorphism S T f g" using homeomorphic_def by blast show "dim S = dim T" - proof (rule order_antisym) - show "dim S \ dim T" - by (metis assms dual_order.refl inj_onI homeomorphism_cont1 [OF hom] homeomorphism_apply1 [OF hom] homeomorphism_image1 [OF hom] continuous_injective_image_subspace_dim_le) - show "dim T \ dim S" - by (metis assms dual_order.refl inj_onI homeomorphism_cont2 [OF hom] homeomorphism_apply2 [OF hom] homeomorphism_image2 [OF hom] continuous_injective_image_subspace_dim_le) - qed + by (metis \S homeomorphic T\ aff_dim_subspace assms homeomorphic_convex_sets of_nat_eq_iff subspace_imp_convex) next assume "dim S = dim T" then show "S homeomorphic T" @@ -3034,11 +2990,11 @@ qed qed -subsection\more invariance of domain\(*FIX ME title? *) +subsection\more invariance of domain\ (*FIX ME title? *) proposition invariance_of_domain_sphere_affine_set_gen: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f ` S \ T" + assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f \ S \ T" and U: "bounded U" "convex U" and "affine T" and affTU: "aff_dim T < aff_dim U" and ope: "openin (top_of_set (rel_frontier U)) S" @@ -3085,8 +3041,8 @@ qed (use contf continuous_on_subset hgsub in blast) show "inj_on (f \ h) (g ` (S - {b}))" by (smt (verit, del_insts) SU homeomorphism_def inj_on_def injf gh Diff_iff comp_apply imageE subset_iff) - show "(f \ h) ` g ` (S - {b}) \ T" - by (metis fim image_comp image_mono hgsub subset_trans) + show "f \ h \ g ` (S - {b}) \ T" + using fim hgsub by fastforce qed (auto simp: assms) moreover have "openin (top_of_set T) ((f \ k) ` j ` (S - {c}))" @@ -3100,20 +3056,15 @@ qed (use contf continuous_on_subset kjsub in blast) show "inj_on (f \ k) (j ` (S - {c}))" by (smt (verit, del_insts) SU homeomorphism_def inj_on_def injf jk Diff_iff comp_apply imageE subset_iff) - show "(f \ k) ` j ` (S - {c}) \ T" - by (metis fim image_comp image_mono kjsub subset_trans) + show "f \ k \ j ` (S - {c}) \ T" + using fim kjsub by fastforce qed (auto simp: assms) ultimately have "openin (top_of_set T) ((f \ h) ` g ` (S - {b}) \ ((f \ k) ` j ` (S - {c})))" by (rule openin_Un) moreover have "(f \ h) ` g ` (S - {b}) = f ` (S - {b})" proof - have "h ` g ` (S - {b}) = (S - {b})" - proof - show "h ` g ` (S - {b}) \ S - {b}" - using homeomorphism_apply1 [OF gh] SU by (fastforce simp add: image_iff image_subset_iff) - show "S - {b} \ h ` g ` (S - {b})" - by (metis Diff_mono SU gh homeomorphism_image2 homeomorphism_of_subsets set_eq_subset) - qed + by (meson Diff_mono Diff_subset SU gh homeomorphism_def homeomorphism_of_subsets subset_singleton_iff) then show ?thesis by (metis image_comp) qed @@ -3134,7 +3085,7 @@ lemma invariance_of_domain_sphere_affine_set: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" - assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f ` S \ T" + assumes contf: "continuous_on S f" and injf: "inj_on f S" and fim: "f \ S \ T" and "r \ 0" "affine T" and affTU: "aff_dim T < DIM('a)" and ope: "openin (top_of_set (sphere a r)) S" shows "openin (top_of_set T) (f ` S)" @@ -3166,9 +3117,10 @@ then have "\ open (f ` sphere a r)" using compact_open by (metis assms(3) image_is_empty not_less_iff_gr_or_eq sphere_eq_empty) - then show False - using invariance_of_domain_sphere_affine_set [OF contf injf subset_UNIV] \r > 0\ - by (metis aff_dim_UNIV affine_UNIV less_irrefl of_nat_less_iff open_openin openin_subtopology_self subtopology_UNIV that) + then have "r=0" + by (metis Pi_I UNIV_I aff_dim_UNIV affine_UNIV contf injf invariance_of_domain_sphere_affine_set + of_nat_less_iff open_openin openin_subtopology_self subtopology_UNIV that) + with \r>0\ show False by auto qed then show ?thesis using not_less by blast @@ -3712,10 +3664,10 @@ assume L: ?lhs then obtain g where contg: "continuous_on S g" and g: "\x. x \ S \ f x = exp(g x)" using inessential_imp_continuous_logarithm_circle by blast - have "f ` S \ sphere 0 1" - by (metis L homotopic_with_imp_subset1) + have "f \ S \ sphere 0 1" + by (metis L image_subset_iff_funcset homotopic_with_imp_subset1) then have "\x. x \ S \ Re (g x) = 0" - using g by auto + using g by (simp add: Pi_iff) then show ?rhs by (rule_tac x="Im \ g" in exI) (auto simp: Euler g intro: contg continuous_intros) next @@ -3747,7 +3699,7 @@ shows "homotopic_with_canon (\x. True) S (sphere 0 1) (\x. f x * h x) (\x. g x * h x)" proof - obtain k where contk: "continuous_on ({0..1::real} \ S) k" - and kim: "k ` ({0..1} \ S) \ sphere 0 1" + and kim: "k \ ({0..1} \ S) \ sphere 0 1" and k0: "\x. k(0, x) = f x" and k1: "\x. k(1, x) = g x" using hom by (auto simp: homotopic_with_def) @@ -3760,8 +3712,8 @@ proposition homotopic_circlemaps_divide: fixes f :: "'a::real_normed_vector \ complex" shows "homotopic_with_canon (\x. True) S (sphere 0 1) f g \ - continuous_on S f \ f ` S \ sphere 0 1 \ - continuous_on S g \ g ` S \ sphere 0 1 \ + continuous_on S f \ f \ S \ sphere 0 1 \ + continuous_on S g \ g \ S \ sphere 0 1 \ (\c. homotopic_with_canon (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. c))" proof - have "homotopic_with_canon (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" @@ -3780,8 +3732,8 @@ homotopic_with_canon (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" by auto have "homotopic_with_canon (\x. True) S (sphere 0 1) f g \ - continuous_on S f \ f ` S \ sphere 0 1 \ - continuous_on S g \ g ` S \ sphere 0 1 \ + continuous_on S f \ f \ S \ sphere 0 1 \ + continuous_on S g \ g \ S \ sphere 0 1 \ homotopic_with_canon (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" (is "?lhs \ ?rhs") proof @@ -3802,7 +3754,7 @@ using homotopic_with_eq [OF homotopic_with_sphere_times [OF L cont]] by (auto simp: divide_inverse norm_inverse) with L show ?rhs - by (simp add: homotopic_with_imp_continuous homotopic_with_imp_subset1 homotopic_with_imp_subset2) + by (simp add: homotopic_with_imp_continuous homotopic_with_imp_funspace1) next assume ?rhs then show ?lhs by (elim conjE homotopic_with_eq [OF homotopic_with_sphere_times]; force) @@ -3882,7 +3834,7 @@ qed lemma open_map_iff_lower_hemicontinuous_preimage: - assumes "f ` S \ T" + assumes "f \ S \ T" shows "((\U. openin (top_of_set S) U \ openin (top_of_set T) (f ` U)) \ (\U. closedin (top_of_set S) U @@ -3913,7 +3865,7 @@ qed lemma closed_map_iff_upper_hemicontinuous_preimage: - assumes "f ` S \ T" + assumes "f \ S \ T" shows "((\U. closedin (top_of_set S) U \ closedin (top_of_set T) (f ` U)) \ (\U. openin (top_of_set S) U @@ -4519,11 +4471,11 @@ assume contf: "continuous_on (S \ T) f" and 0: "\i\S \ T. f i \ 0" then have contfS: "continuous_on S f" and contfT: "continuous_on T f" using continuous_on_subset by auto - have "\continuous_on S f; f ` S \ -{0}\ \ \g. continuous_on S g \ (\x \ S. f x = exp(g x))" + have "\continuous_on S f; f \ S \ -{0}\ \ \g. continuous_on S g \ (\x \ S. f x = exp(g x))" using BS by (auto simp: Borsukian_continuous_logarithm) then obtain g where contg: "continuous_on S g" and fg: "\x. x \ S \ f x = exp(g x)" using "0" contfS by force - have "\continuous_on T f; f ` T \ -{0}\ \ \g. continuous_on T g \ (\x \ T. f x = exp(g x))" + have "\continuous_on T f; f \ T \ -{0}\ \ \g. continuous_on T g \ (\x \ T. f x = exp(g x))" using BT by (auto simp: Borsukian_continuous_logarithm) then obtain h where conth: "continuous_on T h" and fh: "\x. x \ T \ f x = exp(h x)" using "0" contfT by force @@ -4718,12 +4670,12 @@ proof (rule upper_lower_hemicontinuous_explicit [of T "\y. {z \ S. f z = y}" S]) show "\U. openin (top_of_set S) U \ openin (top_of_set T) {x \ T. {z \ S. f z = x} \ U}" - using closed_map_iff_upper_hemicontinuous_preimage [OF fim [THEN equalityD1]] - by (simp add: Abstract_Topology_2.continuous_imp_closed_map \compact S\ contf fim) + using closed_map_iff_upper_hemicontinuous_preimage [of f S T] fim contf \compact S\ + using Abstract_Topology_2.continuous_imp_closed_map by blast show "\U. closedin (top_of_set S) U \ closedin (top_of_set T) {x \ T. {z \ S. f z = x} \ U}" - using ope open_map_iff_lower_hemicontinuous_preimage [OF fim [THEN equalityD1]] - by meson + using ope open_map_iff_lower_hemicontinuous_preimage[of f S T] fim [THEN equalityD1] + by blast show "bounded {z \ S. f z = y}" by (metis (no_types, lifting) compact_imp_bounded [OF \compact S\] bounded_subset mem_Collect_eq subsetI) qed (use \y \ T\ \0 < d\ fk kTS in \force+\) @@ -4918,7 +4870,7 @@ assume "connected U" "connected V" and T: "T = U \ V" and cloU: "closedin (top_of_set T) U" and cloV: "closedin (top_of_set T) V" - have "f ` (g ` U \ g ` V) \ U" "f ` (g ` U \ g ` V) \ V" + have "f \ (g ` U \ g ` V) \ U" "f \ (g ` U \ g ` V) \ V" using gf fim T by auto (metis UnCI image_iff)+ moreover have "U \ V \ f ` (g ` U \ g ` V)" using gf fim by (force simp: image_iff T) @@ -5393,14 +5345,8 @@ lemma nonseparation_by_component_eq: fixes S :: "'a :: euclidean_space set" assumes "open S \ closed S" - shows "((\C \ components S. connected(-C)) \ connected(- S))" (is "?lhs = ?rhs") -proof - assume ?lhs with assms show ?rhs - by (meson separation_by_component_closed separation_by_component_open) -next - assume ?rhs with assms show ?lhs - using component_complement_connected by force -qed + shows "((\C \ components S. connected(-C)) \ connected(- S))" + by (metis assms component_complement_connected double_complement separation_by_component_closed separation_by_component_open) text\Another interesting equivalent of an inessential mapping into C-{0}\ @@ -5421,7 +5367,7 @@ case False have anr: "ANR (-{0::complex})" by (simp add: ANR_delete open_Compl open_imp_ANR) - obtain g where contg: "continuous_on UNIV g" and gim: "g ` UNIV \ -{0}" + obtain g where contg: "continuous_on UNIV g" and gim: "g \ UNIV \ -{0}" and gf: "\x. x \ S \ g x = f x" proof (rule Borsuk_homotopy_extension_homotopic [OF _ _ continuous_on_const _ homotopic_with_symD [OF a]]) show "closedin (top_of_set UNIV) S" @@ -5456,13 +5402,7 @@ by (auto intro: continuous_on_subset [OF contj] simp flip: homeomorphism_image2 [OF hk]) qed show "f x = exp ((j \ k) x)" if "x \ S" for x - proof - - have "f x = (g \ h) (k x)" - by (simp add: gf that) - also have "... = exp (j (k x))" - by (metis rangeI homeomorphism_image2 [OF hk] j) - finally show ?thesis by simp - qed + by (metis UNIV_I comp_apply gf hk homeomorphism_def image_eqI j that) qed then show ?lhs by (simp add: inessential_eq_continuous_logarithm) @@ -5487,7 +5427,7 @@ and ope: "openin (top_of_set (\\)) C" and "homotopic_with_canon (\x. True) C T f (\x. a)" using assms by blast - with \C \ {}\ have "f ` C \ T" "a \ T" + with \C \ {}\ have "f \ C \ T" "a \ T" using homotopic_with_imp_subset1 homotopic_with_imp_subset2 by blast+ have "homotopic_with_canon (\x. True) (\\) T f (\x. a)" proof (rule homotopic_on_clopen_Union) @@ -5514,15 +5454,9 @@ proposition Janiszewski_dual: fixes S :: "complex set" - assumes - "compact S" "compact T" "connected S" "connected T" "connected(- (S \ T))" + assumes "compact S" "compact T" "connected S" "connected T" "connected(- (S \ T))" shows "connected(S \ T)" -proof - - have ST: "compact (S \ T)" - by (simp add: assms compact_Un) - with Borsukian_imp_unicoherent [of "S \ T"] ST assms - show ?thesis - by (simp add: Borsukian_separation_compact closed_subset compact_imp_closed unicoherentD) -qed + by (meson Borsukian_imp_unicoherent Borsukian_separation_compact assms closed_subset compact_Un + compact_imp_closed sup_ge1 sup_ge2 unicoherentD) end diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Analysis/Homotopy.thy --- a/src/HOL/Analysis/Homotopy.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Analysis/Homotopy.thy Sat Aug 12 10:09:29 2023 +0100 @@ -2950,11 +2950,11 @@ obtain B where "B \ S" and Borth: "pairwise orthogonal B" and B1: "\x. x \ B \ norm x = 1" and "independent B" "finite B" "card B = dim S" "span B = S" - by (metis orthonormal_basis_subspace [OF S] independent_finite) + by (metis orthonormal_basis_subspace [OF S] independent_imp_finite) obtain C where "C \ T" and Corth: "pairwise orthogonal C" and C1:"\x. x \ C \ norm x = 1" and "independent C" "finite C" "card C = dim T" "span C = T" - by (metis orthonormal_basis_subspace [OF T] independent_finite) + by (metis orthonormal_basis_subspace [OF T] independent_imp_finite) obtain fb where "fb ` B \ C" "inj_on fb B" by (metis \card B = dim S\ \card C = dim T\ \finite B\ \finite C\ card_le_inj d) then have pairwise_orth_fb: "pairwise (\v j. orthogonal (fb v) (fb j)) B" @@ -3003,11 +3003,11 @@ obtain B where "B \ S" and Borth: "pairwise orthogonal B" and B1: "\x. x \ B \ norm x = 1" and "independent B" "finite B" "card B = dim S" "span B = S" - by (metis orthonormal_basis_subspace [OF S] independent_finite) + by (metis orthonormal_basis_subspace [OF S] independent_imp_finite) obtain C where "C \ T" and Corth: "pairwise orthogonal C" and C1:"\x. x \ C \ norm x = 1" and "independent C" "finite C" "card C = dim T" "span C = T" - by (metis orthonormal_basis_subspace [OF T] independent_finite) + by (metis orthonormal_basis_subspace [OF T] independent_imp_finite) obtain fb where "bij_betw fb B C" by (metis \finite B\ \finite C\ bij_betw_iff_card \card B = dim S\ \card C = dim T\ d) then have pairwise_orth_fb: "pairwise (\v j. orthogonal (fb v) (fb j)) B" diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Probability/Infinite_Product_Measure.thy --- a/src/HOL/Probability/Infinite_Product_Measure.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Probability/Infinite_Product_Measure.thy Sat Aug 12 10:09:29 2023 +0100 @@ -102,13 +102,11 @@ lemma sets_Collect_single': "i \ I \ {x\space (M i). P x} \ sets (M i) \ {x\space (PiM I M). P (x i)} \ sets (PiM I M)" - using sets_Collect_single[of i I "{x\space (M i). P x}" M] - by (simp add: space_PiM PiE_iff cong: conj_cong) + by auto lemma (in finite_product_prob_space) finite_measure_PiM_emb: "(\i. i \ I \ A i \ sets (M i)) \ measure (PiM I M) (Pi\<^sub>E I A) = (\i\I. measure (M i) (A i))" - using measure_PiM_emb[of I A] finite_index prod_emb_PiE_same_index[OF sets.sets_into_space, of I A M] - by auto + by (rule prob_times) lemma (in product_prob_space) PiM_component: assumes "i \ I" diff -r 1425a366fe7f -r 56a408fa2440 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Sun Aug 06 19:00:06 2023 +0100 +++ b/src/HOL/Topological_Spaces.thy Sat Aug 12 10:09:29 2023 +0100 @@ -1220,6 +1220,11 @@ "f \ f0 \ (\S. open S \ f0 \ S \ (\N. \n\N. f n \ S))" unfolding tendsto_def eventually_sequentially by auto +lemma closed_sequentially: + assumes "closed S" and "\n. f n \ S" and "f \ l" + shows "l \ S" + by (metis Lim_in_closed_set assms eventually_sequentially trivial_limit_sequentially) + subsection \Monotone sequences and subsequences\