# HG changeset patch # User wenzelm # Date 1377728282 -7200 # Node ID addd7b9b2bff8bd30f99b9273711ea4f3001815b # Parent 082d0972096bb8b9c922b111fc889d739e9fbc15 tuned proofs; diff -r 082d0972096b -r addd7b9b2bff src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Aug 28 23:48:45 2013 +0200 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Thu Aug 29 00:18:02 2013 +0200 @@ -49,6 +49,7 @@ continuous_on (s \ t) (\x. if P x then f x else g x)" by (rule continuous_on_If) auto + subsection {* Topological Basis *} context topological_space @@ -117,41 +118,51 @@ by (simp add: topological_basis_def) lemma topological_basis_imp_subbasis: - assumes B: "topological_basis B" shows "open = generate_topology B" + assumes B: "topological_basis B" + shows "open = generate_topology B" proof (intro ext iffI) - fix S :: "'a set" assume "open S" + fix S :: "'a set" + assume "open S" with B obtain B' where "B' \ B" "S = \B'" unfolding topological_basis_def by blast then show "generate_topology B S" by (auto intro: generate_topology.intros dest: topological_basis_open) next - fix S :: "'a set" assume "generate_topology B S" then show "open S" + fix S :: "'a set" + assume "generate_topology B S" + then show "open S" by induct (auto dest: topological_basis_open[OF B]) qed lemma basis_dense: - fixes B::"'a set set" and f::"'a set \ 'a" + fixes B::"'a set set" + and f::"'a set \ 'a" assumes "topological_basis B" - assumes choosefrom_basis: "\B'. B' \ {} \ f B' \ B'" + and choosefrom_basis: "\B'. B' \ {} \ f B' \ B'" shows "(\X. open X \ X \ {} \ (\B' \ B. f B' \ X))" proof (intro allI impI) - fix X::"'a set" assume "open X" "X \ {}" + fix X::"'a set" + assume "open X" "X \ {}" from topological_basisE[OF `topological_basis B` `open X` choosefrom_basis[OF `X \ {}`]] guess B' . note B' = this - thus "\B'\B. f B' \ X" by (auto intro!: choosefrom_basis) + then show "\B'\B. f B' \ X" + by (auto intro!: choosefrom_basis) qed end lemma topological_basis_prod: - assumes A: "topological_basis A" and B: "topological_basis B" + assumes A: "topological_basis A" + and B: "topological_basis B" shows "topological_basis ((\(a, b). a \ b) ` (A \ B))" unfolding topological_basis_def proof (safe, simp_all del: ex_simps add: subset_image_iff ex_simps(1)[symmetric]) - fix S :: "('a \ 'b) set" assume "open S" + fix S :: "('a \ 'b) set" + assume "open S" then show "\X\A \ B. (\(a,b)\X. a \ b) = S" proof (safe intro!: exI[of _ "{x\A \ B. fst x \ snd x \ S}"]) - fix x y assume "(x, y) \ S" + fix x y + assume "(x, y) \ S" from open_prod_elim[OF `open S` this] obtain a b where a: "open a""x \ a" and b: "open b" "y \ b" and "a \ b \ S" by (metis mem_Sigma_iff) @@ -162,6 +173,7 @@ qed auto qed (metis A B topological_basis_open open_Times) + subsection {* Countable Basis *} locale countable_basis = @@ -173,12 +185,14 @@ lemma open_countable_basis_ex: assumes "open X" shows "\B' \ B. X = Union B'" - using assms countable_basis is_basis unfolding topological_basis_def by blast + using assms countable_basis is_basis + unfolding topological_basis_def by blast lemma open_countable_basisE: assumes "open X" obtains B' where "B' \ B" "X = Union B'" - using assms open_countable_basis_ex by (atomize_elim) simp + using assms open_countable_basis_ex + by (atomize_elim) simp lemma countable_dense_exists: shows "\D::'a set. countable D \ (\X. open X \ X \ {} \ (\d \ D. d \ X))" @@ -213,34 +227,47 @@ proof atomize_elim from first_countable_basisE[of x] guess A' . note A' = this def A \ "(\N. \((\n. from_nat_into A' n) ` N)) ` (Collect finite::nat set set)" - thus "\A. countable A \ (\a. a \ A \ x \ a) \ (\a. a \ A \ open a) \ + then show "\A. countable A \ (\a. a \ A \ x \ a) \ (\a. a \ A \ open a) \ (\S. open S \ x \ S \ (\a\A. a \ S)) \ (\a b. a \ A \ b \ A \ a \ b \ A)" proof (safe intro!: exI[where x=A]) - show "countable A" unfolding A_def by (intro countable_image countable_Collect_finite) - fix a assume "a \ A" - thus "x \ a" "open a" using A'(4)[OF open_UNIV] by (auto simp: A_def intro: A' from_nat_into) + show "countable A" + unfolding A_def by (intro countable_image countable_Collect_finite) + fix a + assume "a \ A" + then show "x \ a" "open a" + using A'(4)[OF open_UNIV] by (auto simp: A_def intro: A' from_nat_into) next let ?int = "\N. \(from_nat_into A' ` N)" - fix a b assume "a \ A" "b \ A" - then obtain N M where "a = ?int N" "b = ?int M" "finite (N \ M)" by (auto simp: A_def) - thus "a \ b \ A" by (auto simp: A_def intro!: image_eqI[where x="N \ M"]) + fix a b + assume "a \ A" "b \ A" + then obtain N M where "a = ?int N" "b = ?int M" "finite (N \ M)" + by (auto simp: A_def) + then show "a \ b \ A" + by (auto simp: A_def intro!: image_eqI[where x="N \ M"]) next - fix S assume "open S" "x \ S" then obtain a where a: "a\A'" "a \ S" using A' by blast - thus "\a\A. a \ S" using a A' + fix S + assume "open S" "x \ S" + then obtain a where a: "a\A'" "a \ S" using A' by blast + then show "\a\A. a \ S" using a A' by (intro bexI[where x=a]) (auto simp: A_def intro: image_eqI[where x="{to_nat_on A' a}"]) qed qed lemma (in topological_space) first_countableI: - assumes "countable A" and 1: "\a. a \ A \ x \ a" "\a. a \ A \ open a" - and 2: "\S. open S \ x \ S \ \a\A. a \ S" + assumes "countable A" + and 1: "\a. a \ A \ x \ a" "\a. a \ A \ open a" + and 2: "\S. open S \ x \ S \ \a\A. a \ S" shows "\A::nat \ 'a set. (\i. x \ A i \ open (A i)) \ (\S. open S \ x \ S \ (\i. A i \ S))" proof (safe intro!: exI[of _ "from_nat_into A"]) + fix i have "A \ {}" using 2[of UNIV] by auto - { fix i show "x \ from_nat_into A i" "open (from_nat_into A i)" - using range_from_nat_into_subset[OF `A \ {}`] 1 by auto } - { fix S assume "open S" "x\S" from 2[OF this] show "\i. from_nat_into A i \ S" - using subset_range_from_nat_into[OF `countable A`] by auto } + show "x \ from_nat_into A i" "open (from_nat_into A i)" + using range_from_nat_into_subset[OF `A \ {}`] 1 by auto +next + fix S + assume "open S" "x\S" from 2[OF this] + show "\i. from_nat_into A i \ S" + using subset_range_from_nat_into[OF `countable A`] by auto qed instance prod :: (first_countable_topology, first_countable_topology) first_countable_topology @@ -250,11 +277,13 @@ from first_countable_basisE[of "snd x"] guess B :: "'b set set" . note B = this show "\A::nat \ ('a \ 'b) set. (\i. x \ A i \ open (A i)) \ (\S. open S \ x \ S \ (\i. A i \ S))" proof (rule first_countableI[of "(\(a, b). a \ b) ` (A \ B)"], safe) - fix a b assume x: "a \ A" "b \ B" + fix a b + assume x: "a \ A" "b \ B" with A(2, 3)[of a] B(2, 3)[of b] show "x \ a \ b" "open (a \ b)" unfolding mem_Times_iff by (auto intro: open_Times) next - fix S assume "open S" "x \ S" + fix S + assume "open S" "x \ S" from open_prod_elim[OF this] guess a' b' . moreover with A(4)[of a'] B(4)[of b'] obtain a b where "a \ A" "a \ a'" "b \ B" "b \ b'" by auto @@ -269,18 +298,22 @@ lemma ex_countable_basis: "\B::'a set set. countable B \ topological_basis B" proof - - from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B" by blast + from ex_countable_subbasis obtain B where B: "countable B" "open = generate_topology B" + by blast let ?B = "Inter ` {b. finite b \ b \ B }" show ?thesis proof (intro exI conjI) show "countable ?B" by (intro countable_image countable_Collect_finite_subset B) - { fix S assume "open S" + { + fix S + assume "open S" then have "\B'\{b. finite b \ b \ B}. (\b\B'. \b) = S" unfolding B proof induct - case UNIV show ?case by (intro exI[of _ "{{}}"]) simp + case UNIV + show ?case by (intro exI[of _ "{{}}"]) simp next case (Int a b) then obtain x y where x: "a = UNION x Inter" "\i. i \ x \ finite i \ i \ B" @@ -296,7 +329,8 @@ then show "\B'\{b. finite b \ b \ B}. UNION B' Inter = \K" by (intro exI[of _ "UNION K k"]) auto next - case (Basis S) then show ?case + case (Basis S) + then show ?case by (intro exI[of _ "{{S}}"]) auto qed then have "(\B'\Inter ` {b. finite b \ b \ B}. \B' = S)" @@ -339,6 +373,7 @@ (fastforce simp: topological_space_class.topological_basis_def)+ qed + subsection {* Polish spaces *} text {* Textbooks define Polish spaces as completely metrizable. @@ -348,7 +383,9 @@ subsection {* General notion of a topology as a value *} -definition "istopology L \ L {} \ (\S T. L S \ L T \ L (S \ T)) \ (\K. Ball K L \ L (\ K))" +definition "istopology L \ + L {} \ (\S T. L S \ L T \ L (S \ T)) \ (\K. Ball K L \ L (\ K))" + typedef 'a topology = "{L::('a set) \ bool. istopology L}" morphisms "openin" "topology" unfolding istopology_def by blast @@ -363,16 +400,14 @@ using topology_inverse[of U] istopology_open_in[of "topology U"] by auto lemma topology_eq: "T1 = T2 \ (\S. openin T1 S \ openin T2 S)" -proof- - { assume "T1=T2" - hence "\S. openin T1 S \ openin T2 S" by simp } - moreover - { assume H: "\S. openin T1 S \ openin T2 S" - hence "openin T1 = openin T2" by (simp add: fun_eq_iff) - hence "topology (openin T1) = topology (openin T2)" by simp - hence "T1 = T2" unfolding openin_inverse . - } - ultimately show ?thesis by blast +proof + assume "T1 = T2" + then show "\S. openin T1 S \ openin T2 S" by simp +next + assume H: "\S. openin T1 S \ openin T2 S" + then have "openin T1 = openin T2" by (simp add: fun_eq_iff) + then have "topology (openin T1) = topology (openin T2)" by simp + then show "T1 = T2" unfolding openin_inverse . qed text{* Infer the "universe" from union of all sets in the topology. *} @@ -391,7 +426,9 @@ lemma openin_subset[intro]: "openin U S \ S \ topspace U" unfolding topspace_def by blast -lemma openin_empty[simp]: "openin U {}" by (simp add: openin_clauses) + +lemma openin_empty[simp]: "openin U {}" + by (simp add: openin_clauses) lemma openin_Int[intro]: "openin U S \ openin U T \ openin U (S \ T)" using openin_clauses by simp @@ -402,7 +439,8 @@ lemma openin_Un[intro]: "openin U S \ openin U T \ openin U (S \ T)" using openin_Union[of "{S,T}" U] by auto -lemma openin_topspace[intro, simp]: "openin U (topspace U)" by (simp add: openin_Union topspace_def) +lemma openin_topspace[intro, simp]: "openin U (topspace U)" + by (simp add: openin_Union topspace_def) lemma openin_subopen: "openin U S \ (\x \ S. \T. openin U T \ x \ T \ T \ S)" (is "?lhs \ ?rhs") @@ -422,42 +460,63 @@ definition "closedin U S \ S \ topspace U \ openin U (topspace U - S)" -lemma closedin_subset: "closedin U S \ S \ topspace U" by (metis closedin_def) -lemma closedin_empty[simp]: "closedin U {}" by (simp add: closedin_def) -lemma closedin_topspace[intro,simp]: - "closedin U (topspace U)" by (simp add: closedin_def) +lemma closedin_subset: "closedin U S \ S \ topspace U" + by (metis closedin_def) + +lemma closedin_empty[simp]: "closedin U {}" + by (simp add: closedin_def) + +lemma closedin_topspace[intro, simp]: "closedin U (topspace U)" + by (simp add: closedin_def) + lemma closedin_Un[intro]: "closedin U S \ closedin U T \ closedin U (S \ T)" by (auto simp add: Diff_Un closedin_def) -lemma Diff_Inter[intro]: "A - \S = \ {A - s|s. s\S}" by auto -lemma closedin_Inter[intro]: assumes Ke: "K \ {}" and Kc: "\S \K. closedin U S" - shows "closedin U (\ K)" using Ke Kc unfolding closedin_def Diff_Inter by auto +lemma Diff_Inter[intro]: "A - \S = \ {A - s|s. s\S}" + by auto + +lemma closedin_Inter[intro]: + assumes Ke: "K \ {}" + and Kc: "\S \K. closedin U S" + shows "closedin U (\ K)" + using Ke Kc unfolding closedin_def Diff_Inter by auto lemma closedin_Int[intro]: "closedin U S \ closedin U T \ closedin U (S \ T)" using closedin_Inter[of "{S,T}" U] by auto -lemma Diff_Diff_Int: "A - (A - B) = A \ B" by blast +lemma Diff_Diff_Int: "A - (A - B) = A \ B" + by blast + lemma openin_closedin_eq: "openin U S \ S \ topspace U \ closedin U (topspace U - S)" apply (auto simp add: closedin_def Diff_Diff_Int inf_absorb2) apply (metis openin_subset subset_eq) done -lemma openin_closedin: "S \ topspace U \ (openin U S \ closedin U (topspace U - S))" +lemma openin_closedin: "S \ topspace U \ (openin U S \ closedin U (topspace U - S))" by (simp add: openin_closedin_eq) -lemma openin_diff[intro]: assumes oS: "openin U S" and cT: "closedin U T" shows "openin U (S - T)" -proof- +lemma openin_diff[intro]: + assumes oS: "openin U S" + and cT: "closedin U T" + shows "openin U (S - T)" +proof - have "S - T = S \ (topspace U - T)" using openin_subset[of U S] oS cT by (auto simp add: topspace_def openin_subset) then show ?thesis using oS cT by (auto simp add: closedin_def) qed -lemma closedin_diff[intro]: assumes oS: "closedin U S" and cT: "openin U T" shows "closedin U (S - T)" -proof- - have "S - T = S \ (topspace U - T)" using closedin_subset[of U S] oS cT - by (auto simp add: topspace_def ) - then show ?thesis using oS cT by (auto simp add: openin_closedin_eq) -qed +lemma closedin_diff[intro]: + assumes oS: "closedin U S" + and cT: "openin U T" + shows "closedin U (S - T)" +proof - + have "S - T = S \ (topspace U - T)" + using closedin_subset[of U S] oS cT + by (auto simp add: topspace_def) + then show ?thesis + using oS cT by (auto simp add: openin_closedin_eq) +qed + subsubsection {* Subspace topology *} @@ -465,48 +524,59 @@ lemma istopology_subtopology: "istopology (\T. \S. T = S \ V \ openin U S)" (is "istopology ?L") -proof- +proof - have "?L {}" by blast - {fix A B assume A: "?L A" and B: "?L B" - from A B obtain Sa and Sb where Sa: "openin U Sa" "A = Sa \ V" and Sb: "openin U Sb" "B = Sb \ V" by blast - have "A\B = (Sa \ Sb) \ V" "openin U (Sa \ Sb)" using Sa Sb by blast+ - then have "?L (A \ B)" by blast} + { + fix A B + assume A: "?L A" and B: "?L B" + from A B obtain Sa and Sb where Sa: "openin U Sa" "A = Sa \ V" and Sb: "openin U Sb" "B = Sb \ V" + by blast + have "A \ B = (Sa \ Sb) \ V" "openin U (Sa \ Sb)" + using Sa Sb by blast+ + then have "?L (A \ B)" by blast + } moreover - {fix K assume K: "K \ Collect ?L" + { + fix K assume K: "K \ Collect ?L" have th0: "Collect ?L = (\S. S \ V) ` Collect (openin U)" apply (rule set_eqI) apply (simp add: Ball_def image_iff) - by metis + apply metis + done from K[unfolded th0 subset_image_iff] - obtain Sk where Sk: "Sk \ Collect (openin U)" "K = (\S. S \ V) ` Sk" by blast - have "\K = (\Sk) \ V" using Sk by auto - moreover have "openin U (\ Sk)" using Sk by (auto simp add: subset_eq) - ultimately have "?L (\K)" by blast} + obtain Sk where Sk: "Sk \ Collect (openin U)" "K = (\S. S \ V) ` Sk" + by blast + have "\K = (\Sk) \ V" + using Sk by auto + moreover have "openin U (\ Sk)" + using Sk by (auto simp add: subset_eq) + ultimately have "?L (\K)" by blast + } ultimately show ?thesis unfolding subset_eq mem_Collect_eq istopology_def by blast qed -lemma openin_subtopology: - "openin (subtopology U V) S \ (\ T. (openin U T) \ (S = T \ V))" +lemma openin_subtopology: "openin (subtopology U V) S \ (\T. openin U T \ S = T \ V)" unfolding subtopology_def topology_inverse'[OF istopology_subtopology] by auto -lemma topspace_subtopology: "topspace(subtopology U V) = topspace U \ V" +lemma topspace_subtopology: "topspace (subtopology U V) = topspace U \ V" by (auto simp add: topspace_def openin_subtopology) -lemma closedin_subtopology: - "closedin (subtopology U V) S \ (\T. closedin U T \ S = T \ V)" +lemma closedin_subtopology: "closedin (subtopology U V) S \ (\T. closedin U T \ S = T \ V)" unfolding closedin_def topspace_subtopology apply (simp add: openin_subtopology) apply (rule iffI) apply clarify apply (rule_tac x="topspace U - T" in exI) - by auto + apply auto + done lemma openin_subtopology_refl: "openin (subtopology U V) V \ V \ topspace U" unfolding openin_subtopology apply (rule iffI, clarify) - apply (frule openin_subset[of U]) apply blast + apply (frule openin_subset[of U]) + apply blast apply (rule exI[where x="topspace U"]) apply auto done @@ -514,17 +584,28 @@ lemma subtopology_superset: assumes UV: "topspace U \ V" shows "subtopology U V = U" -proof- - {fix S - {fix T assume T: "openin U T" "S = T \ V" - from T openin_subset[OF T(1)] UV have eq: "S = T" by blast - have "openin U S" unfolding eq using T by blast} +proof - + { + fix S + { + fix T + assume T: "openin U T" "S = T \ V" + from T openin_subset[OF T(1)] UV have eq: "S = T" + by blast + have "openin U S" + unfolding eq using T by blast + } moreover - {assume S: "openin U S" - hence "\T. openin U T \ S = T \ V" - using openin_subset[OF S] UV by auto} - ultimately have "(\T. openin U T \ S = T \ V) \ openin U S" by blast} - then show ?thesis unfolding topology_eq openin_subtopology by blast + { + assume S: "openin U S" + then have "\T. openin U T \ S = T \ V" + using openin_subset[OF S] UV by auto + } + ultimately have "(\T. openin U T \ S = T \ V) \ openin U S" + by blast + } + then show ?thesis + unfolding topology_eq openin_subtopology by blast qed lemma subtopology_topspace[simp]: "subtopology U (topspace U) = U" @@ -533,11 +614,11 @@ lemma subtopology_UNIV[simp]: "subtopology U UNIV = U" by (simp add: subtopology_superset) + subsubsection {* The standard Euclidean topology *} -definition - euclidean :: "'a::topological_space topology" where - "euclidean = topology open" +definition euclidean :: "'a::topological_space topology" + where "euclidean = topology open" lemma open_openin: "open S \ openin euclidean S" unfolding euclidean_def @@ -549,7 +630,8 @@ lemma topspace_euclidean: "topspace euclidean = UNIV" apply (simp add: topspace_def) apply (rule set_eqI) - by (auto simp add: open_openin[symmetric]) + apply (auto simp add: open_openin[symmetric]) + done lemma topspace_euclidean_subtopology[simp]: "topspace (subtopology euclidean S) = S" by (simp add: topspace_euclidean topspace_subtopology) @@ -569,10 +651,10 @@ by (auto simp add: openin_open) lemma open_openin_trans[trans]: - "open S \ open T \ T \ S \ openin (subtopology euclidean S) T" + "open S \ open T \ T \ S \ openin (subtopology euclidean S) T" by (metis Int_absorb1 openin_open_Int) -lemma open_subset: "S \ T \ open S \ openin (subtopology euclidean T) S" +lemma open_subset: "S \ T \ open S \ openin (subtopology euclidean T) S" by (auto simp add: openin_open) lemma closedin_closed: "closedin (subtopology euclidean U) S \ (\T. closed T \ S = U \ T)" @@ -593,10 +675,12 @@ lemma openin_euclidean_subtopology_iff: fixes S U :: "'a::metric_space set" - shows "openin (subtopology euclidean U) S - \ S \ U \ (\x\S. \e>0. \x'\U. dist x' x < e \ x'\ S)" (is "?lhs \ ?rhs") + shows "openin (subtopology euclidean U) S \ + S \ U \ (\x\S. \e>0. \x'\U. dist x' x < e \ x'\ S)" + (is "?lhs \ ?rhs") proof - assume ?lhs thus ?rhs unfolding openin_open open_dist by blast + assume ?lhs + then show ?rhs unfolding openin_open open_dist by blast next def T \ "{x. \a\S. \d>0. (\y\U. dist y a < d \ y \ S) \ dist x a < d}" have 1: "\x\T. \e>0. \y. dist y x < e \ y \ T" @@ -620,17 +704,17 @@ text {* These "transitivity" results are handy too *} -lemma openin_trans[trans]: "openin (subtopology euclidean T) S \ openin (subtopology euclidean U) T - \ openin (subtopology euclidean U) S" +lemma openin_trans[trans]: + "openin (subtopology euclidean T) S \ openin (subtopology euclidean U) T \ + openin (subtopology euclidean U) S" unfolding open_openin openin_open by blast lemma openin_open_trans: "openin (subtopology euclidean T) S \ open T \ open S" by (auto simp add: openin_open intro: openin_trans) lemma closedin_trans[trans]: - "closedin (subtopology euclidean T) S \ - closedin (subtopology euclidean U) T - ==> closedin (subtopology euclidean U) S" + "closedin (subtopology euclidean T) S \ closedin (subtopology euclidean U) T \ + closedin (subtopology euclidean U) S" by (auto simp add: closedin_closed closed_closedin closed_Inter Int_assoc) lemma closedin_closed_trans: "closedin (subtopology euclidean T) S \ closed T \ closed S" @@ -639,13 +723,11 @@ subsection {* Open and closed balls *} -definition - ball :: "'a::metric_space \ real \ 'a set" where - "ball x e = {y. dist x y < e}" - -definition - cball :: "'a::metric_space \ real \ 'a set" where - "cball x e = {y. dist x y \ e}" +definition ball :: "'a::metric_space \ real \ 'a set" + where "ball x e = {y. dist x y < e}" + +definition cball :: "'a::metric_space \ real \ 'a set" + where "cball x e = {y. dist x y \ e}" lemma mem_ball [simp]: "y \ ball x e \ dist x y < e" by (simp add: ball_def) @@ -669,20 +751,33 @@ lemma centre_in_cball: "x \ cball x e \ 0 \ e" by simp -lemma ball_subset_cball[simp,intro]: "ball x e \ cball x e" by (simp add: subset_eq) -lemma subset_ball[intro]: "d <= e ==> ball x d \ ball x e" by (simp add: subset_eq) -lemma subset_cball[intro]: "d <= e ==> cball x d \ cball x e" by (simp add: subset_eq) +lemma ball_subset_cball[simp,intro]: "ball x e \ cball x e" + by (simp add: subset_eq) + +lemma subset_ball[intro]: "d <= e ==> ball x d \ ball x e" + by (simp add: subset_eq) + +lemma subset_cball[intro]: "d <= e ==> cball x d \ cball x e" + by (simp add: subset_eq) + lemma ball_max_Un: "ball a (max r s) = ball a r \ ball a s" by (simp add: set_eq_iff) arith lemma ball_min_Int: "ball a (min r s) = ball a r \ ball a s" by (simp add: set_eq_iff) -lemma diff_less_iff: "(a::real) - b > 0 \ a > b" +lemma diff_less_iff: + "(a::real) - b > 0 \ a > b" "(a::real) - b < 0 \ a < b" - "a - b < c \ a < c +b" "a - b > c \ a > c +b" by arith+ -lemma diff_le_iff: "(a::real) - b \ 0 \ a \ b" "(a::real) - b \ 0 \ a \ b" - "a - b \ c \ a \ c +b" "a - b \ c \ a \ c +b" by arith+ + "a - b < c \ a < c + b" "a - b > c \ a > c + b" + by arith+ + +lemma diff_le_iff: + "(a::real) - b \ 0 \ a \ b" + "(a::real) - b \ 0 \ a \ b" + "a - b \ c \ a \ c + b" + "a - b \ c \ a \ c + b" + by arith+ lemma open_ball[intro, simp]: "open (ball x e)" unfolding open_dist ball_def mem_Collect_eq Ball_def @@ -730,30 +825,41 @@ shows "\a b. (\i\Basis. a \ i \ \ \ b \ i \ \ ) \ x \ box a b \ box a b \ ball x e" proof - def e' \ "e / (2 * sqrt (real (DIM ('a))))" - then have e: "0 < e'" using assms by (auto intro!: divide_pos_pos simp: DIM_positive) + then have e: "0 < e'" + using assms by (auto intro!: divide_pos_pos simp: DIM_positive) have "\i. \y. y \ \ \ y < x \ i \ x \ i - y < e'" (is "\i. ?th i") proof - fix i from Rats_dense_in_real[of "x \ i - e'" "x \ i"] e show "?th i" by auto + fix i + from Rats_dense_in_real[of "x \ i - e'" "x \ i"] e + show "?th i" by auto qed from choice[OF this] guess a .. note a = this have "\i. \y. y \ \ \ x \ i < y \ y - x \ i < e'" (is "\i. ?th i") proof - fix i from Rats_dense_in_real[of "x \ i" "x \ i + e'"] e show "?th i" by auto + fix i + from Rats_dense_in_real[of "x \ i" "x \ i + e'"] e + show "?th i" by auto qed from choice[OF this] guess b .. note b = this let ?a = "\i\Basis. a i *\<^sub>R i" and ?b = "\i\Basis. b i *\<^sub>R i" show ?thesis proof (rule exI[of _ ?a], rule exI[of _ ?b], safe) - fix y :: 'a assume *: "y \ box ?a ?b" + fix y :: 'a + assume *: "y \ box ?a ?b" have "dist x y = sqrt (\i\Basis. (dist (x \ i) (y \ i))\<^sup>2)" unfolding setL2_def[symmetric] by (rule euclidean_dist_l2) also have "\ < sqrt (\(i::'a)\Basis. e^2 / real (DIM('a)))" proof (rule real_sqrt_less_mono, rule setsum_strict_mono) - fix i :: "'a" assume i: "i \ Basis" - have "a i < y\i \ y\i < b i" using * i by (auto simp: box_def) - moreover have "a i < x\i" "x\i - a i < e'" using a by auto - moreover have "x\i < b i" "b i - x\i < e'" using b by auto - ultimately have "\x\i - y\i\ < 2 * e'" by auto + fix i :: "'a" + assume i: "i \ Basis" + have "a i < y\i \ y\i < b i" + using * i by (auto simp: box_def) + moreover have "a i < x\i" "x\i - a i < e'" + using a by auto + moreover have "x\i < b i" "b i - x\i < e'" + using b by auto + ultimately have "\x\i - y\i\ < 2 * e'" + by auto then have "dist (x \ i) (y \ i) < e/sqrt (real (DIM('a)))" unfolding e'_def by (auto simp: dist_real_def) then have "(dist (x \ i) (y \ i))\<^sup>2 < (e/sqrt (real (DIM('a))))\<^sup>2" @@ -761,8 +867,10 @@ then show "(dist (x \ i) (y \ i))\<^sup>2 < e\<^sup>2 / real DIM('a)" by (simp add: power_divide) qed auto - also have "\ = e" using `0 < e` by (simp add: real_eq_of_nat) - finally show "y \ ball x e" by (auto simp: ball_def) + also have "\ = e" + using `0 < e` by (simp add: real_eq_of_nat) + finally show "y \ ball x e" + by (auto simp: ball_def) qed (insert a b, auto simp: box_def) qed @@ -792,51 +900,67 @@ subsection{* Connectedness *} lemma connected_local: - "connected S \ ~(\e1 e2. - openin (subtopology euclidean S) e1 \ - openin (subtopology euclidean S) e2 \ - S \ e1 \ e2 \ - e1 \ e2 = {} \ - ~(e1 = {}) \ - ~(e2 = {}))" -unfolding connected_def openin_open by (safe, blast+) + "connected S \ + \ (\e1 e2. + openin (subtopology euclidean S) e1 \ + openin (subtopology euclidean S) e2 \ + S \ e1 \ e2 \ + e1 \ e2 = {} \ + e1 \ {} \ + e2 \ {})" + unfolding connected_def openin_open by (safe, blast+) lemma exists_diff: fixes P :: "'a set \ bool" shows "(\S. P(- S)) \ (\S. P S)" (is "?lhs \ ?rhs") -proof- - {assume "?lhs" hence ?rhs by blast } +proof - + { + assume "?lhs" + then have ?rhs by blast + } moreover - {fix S assume H: "P S" + { + fix S + assume H: "P S" have "S = - (- S)" by auto - with H have "P (- (- S))" by metis } + with H have "P (- (- S))" by metis + } ultimately show ?thesis by metis qed lemma connected_clopen: "connected S \ - (\T. openin (subtopology euclidean S) T \ - closedin (subtopology euclidean S) T \ T = {} \ T = S)" (is "?lhs \ ?rhs") -proof- - have " \ connected S \ (\e1 e2. open e1 \ open (- e2) \ S \ e1 \ (- e2) \ e1 \ (- e2) \ S = {} \ e1 \ S \ {} \ (- e2) \ S \ {})" + (\T. openin (subtopology euclidean S) T \ + closedin (subtopology euclidean S) T \ T = {} \ T = S)" (is "?lhs \ ?rhs") +proof - + have "\ connected S \ + (\e1 e2. open e1 \ open (- e2) \ S \ e1 \ (- e2) \ e1 \ (- e2) \ S = {} \ e1 \ S \ {} \ (- e2) \ S \ {})" unfolding connected_def openin_open closedin_closed apply (subst exists_diff) apply blast done - hence th0: "connected S \ \ (\e2 e1. closed e2 \ open e1 \ S \ e1 \ (- e2) \ e1 \ (- e2) \ S = {} \ e1 \ S \ {} \ (- e2) \ S \ {})" + hence th0: "connected S \ + \ (\e2 e1. closed e2 \ open e1 \ S \ e1 \ (- e2) \ e1 \ (- e2) \ S = {} \ e1 \ S \ {} \ (- e2) \ S \ {})" (is " _ \ \ (\e2 e1. ?P e2 e1)") apply (simp add: closed_def) apply metis done - have th1: "?rhs \ \ (\t' t. closed t'\t = S\t' \ t\{} \ t\S \ (\t'. open t' \ t = S \ t'))" (is "_ \ \ (\t' t. ?Q t' t)") unfolding connected_def openin_open closedin_closed by auto - {fix e2 - {fix e1 have "?P e2 e1 \ (\t. closed e2 \ t = S\e2 \ open e1 \ t = S\e1 \ t\{} \ t\S)" - by auto} - then have "(\e1. ?P e2 e1) \ (\t. ?Q e2 t)" by metis} - then have "\e2. (\e1. ?P e2 e1) \ (\t. ?Q e2 t)" by blast - then show ?thesis unfolding th0 th1 by simp + { + fix e2 + { + fix e1 + have "?P e2 e1 \ (\t. closed e2 \ t = S\e2 \ open e1 \ t = S\e1 \ t\{} \ t\S)" + by auto + } + then have "(\e1. ?P e2 e1) \ (\t. ?Q e2 t)" + by metis + } + then have "\e2. (\e1. ?P e2 e1) \ (\t. ?Q e2 t)" + by blast + then show ?thesis + unfolding th0 th1 by simp qed lemma connected_empty[simp, intro]: "connected {}" (* FIXME duplicate? *) @@ -845,9 +969,8 @@ subsection{* Limit points *} -definition (in topological_space) - islimpt:: "'a \ 'a set \ bool" (infixr "islimpt" 60) where - "x islimpt S \ (\T. x\T \ open T \ (\y\S. y\T \ y\x))" +definition (in topological_space) islimpt:: "'a \ 'a set \ bool" (infixr "islimpt" 60) + where "x islimpt S \ (\T. x\T \ open T \ (\y\S. y\T \ y\x))" lemma islimptI: assumes "\T. x \ T \ open T \ \y\S. y \ T \ y \ x" @@ -862,7 +985,7 @@ lemma islimpt_iff_eventually: "x islimpt S \ \ eventually (\y. y \ S) (at x)" unfolding islimpt_def eventually_at_topological by auto -lemma islimpt_subset: "\x islimpt S; S \ T\ \ x islimpt T" +lemma islimpt_subset: "x islimpt S \ S \ T \ x islimpt T" unfolding islimpt_def by fast lemma islimpt_approachable: @@ -892,8 +1015,8 @@ lemma perfect_choose_dist: fixes x :: "'a::{perfect_space, metric_space}" shows "0 < r \ \a. a \ x \ dist a x < r" -using islimpt_UNIV [of x] -by (simp add: islimpt_approachable) + using islimpt_UNIV [of x] + by (simp add: islimpt_approachable) lemma closed_limpt: "closed S \ (\x. x islimpt S \ x \ S)" unfolding closed_def @@ -907,20 +1030,29 @@ lemma finite_set_avoid: fixes a :: "'a::metric_space" - assumes fS: "finite S" shows "\d>0. \x\S. x \ a \ d <= dist a x" -proof(induct rule: finite_induct[OF fS]) - case 1 thus ?case by (auto intro: zero_less_one) + assumes fS: "finite S" + shows "\d>0. \x\S. x \ a \ d <= dist a x" +proof (induct rule: finite_induct[OF fS]) + case 1 + then show ?case by (auto intro: zero_less_one) next case (2 x F) - from 2 obtain d where d: "d >0" "\x\F. x\a \ d \ dist a x" by blast - {assume "x = a" hence ?case using d by auto } - moreover - {assume xa: "x\a" + from 2 obtain d where d: "d >0" "\x\F. x\a \ d \ dist a x" + by blast + show ?case + proof (cases "x = a") + case True + then show ?thesis using d by auto + next + case False let ?d = "min d (dist a x)" - have dp: "?d > 0" using xa d(1) using dist_nz by auto - from d have d': "\x\F. x\a \ ?d \ dist a x" by auto - with dp xa have ?case by(auto intro!: exI[where x="?d"]) } - ultimately show ?case by blast + have dp: "?d > 0" + using False d(1) using dist_nz by auto + from d have d': "\x\F. x\a \ ?d \ dist a x" + by auto + with dp False show ?thesis + by (auto intro!: exI[where x="?d"]) + qed qed lemma islimpt_Un: "x islimpt (S \ T) \ x islimpt S \ x islimpt T" @@ -928,20 +1060,27 @@ lemma discrete_imp_closed: fixes S :: "'a::metric_space set" - assumes e: "0 < e" and d: "\x \ S. \y \ S. dist y x < e \ y = x" + assumes e: "0 < e" + and d: "\x \ S. \y \ S. dist y x < e \ y = x" shows "closed S" -proof- - {fix x assume C: "\e>0. \x'\S. x' \ x \ dist x' x < e" +proof - + { + fix x + assume C: "\e>0. \x'\S. x' \ x \ dist x' x < e" from e have e2: "e/2 > 0" by arith - from C[rule_format, OF e2] obtain y where y: "y \ S" "y\x" "dist y x < e/2" by blast + from C[rule_format, OF e2] obtain y where y: "y \ S" "y\x" "dist y x < e/2" + by blast let ?m = "min (e/2) (dist x y) " - from e2 y(2) have mp: "?m > 0" by (simp add: dist_nz[THEN sym]) - from C[rule_format, OF mp] obtain z where z: "z \ S" "z\x" "dist z x < ?m" by blast + from e2 y(2) have mp: "?m > 0" + by (simp add: dist_nz[THEN sym]) + from C[rule_format, OF mp] obtain z where z: "z \ S" "z\x" "dist z x < ?m" + by blast have th: "dist z y < e" using z y by (intro dist_triangle_lt [where z=x], simp) from d[rule_format, OF y(1) z(1) th] y z have False by (auto simp add: dist_commute)} - then show ?thesis by (metis islimpt_approachable closed_limpt [where 'a='a]) + then show ?thesis + by (metis islimpt_approachable closed_limpt [where 'a='a]) qed @@ -1005,7 +1144,8 @@ lemma interior_limit_point [intro]: fixes x :: "'a::perfect_space" - assumes x: "x \ interior S" shows "x islimpt S" + assumes x: "x \ interior S" + shows "x islimpt S" using x islimpt_UNIV [of x] unfolding interior_def islimpt_def apply (clarsimp, rename_tac T T') @@ -1014,15 +1154,16 @@ done lemma interior_closed_Un_empty_interior: - assumes cS: "closed S" and iT: "interior T = {}" + assumes cS: "closed S" + and iT: "interior T = {}" shows "interior (S \ T) = interior S" proof show "interior S \ interior (S \ T)" - by (rule interior_mono, rule Un_upper1) -next + by (rule interior_mono) (rule Un_upper1) show "interior (S \ T) \ interior S" proof - fix x assume "x \ interior (S \ T)" + fix x + assume "x \ interior (S \ T)" then obtain R where "open R" "x \ R" "R \ S \ T" .. show "x \ interior S" proof (rule ccontr) @@ -1043,14 +1184,17 @@ by (intro Sigma_mono interior_subset) show "open (interior A \ interior B)" by (intro open_Times open_interior) - fix T assume "T \ A \ B" and "open T" thus "T \ interior A \ interior B" + fix T + assume "T \ A \ B" and "open T" + then show "T \ interior A \ interior B" proof (safe) - fix x y assume "(x, y) \ T" + fix x y + assume "(x, y) \ T" then obtain C D where "open C" "open D" "C \ D \ T" "x \ C" "y \ D" using `open T` unfolding open_prod_def by fast - hence "open C" "open D" "C \ A" "D \ B" "x \ C" "y \ D" + then have "open C" "open D" "C \ A" "D \ B" "x \ C" "y \ D" using `T \ A \ B` by auto - thus "x \ interior A" and "y \ interior B" + then show "x \ interior A" and "y \ interior B" by (auto intro: interiorI) qed qed @@ -1091,8 +1235,9 @@ unfolding closure_hull by (rule hull_minimal) lemma closure_unique: - assumes "S \ T" and "closed T" - assumes "\T'. S \ T' \ closed T' \ T \ T'" + assumes "S \ T" + and "closed T" + and "\T'. S \ T' \ closed T' \ T \ T'" shows "closure S = T" using assms unfolding closure_hull by (rule hull_unique) @@ -1125,7 +1270,8 @@ proof fix x assume as: "open S" "x \ S \ closure T" - { assume *:"x islimpt T" + { + assume *:"x islimpt T" have "x islimpt (S \ T)" proof (rule islimptI) fix A @@ -1134,9 +1280,9 @@ by (simp_all add: open_Int) with * obtain y where "y \ T" "y \ A \ S" "y \ x" by (rule islimptE) - hence "y \ S \ T" "y \ A \ y \ x" + then have "y \ S \ T" "y \ A \ y \ x" by simp_all - thus "\y\(S \ T). y \ A \ y \ x" .. + then show "\y\(S \ T). y \ A \ y \ x" .. qed } then show "x \ closure (S \ T)" using as @@ -1167,7 +1313,6 @@ done qed - lemma islimpt_in_closure: "(x islimpt S) = (x:closure(S-{x}))" unfolding closure_def using islimpt_punctured by blast @@ -1176,7 +1321,7 @@ definition "frontier S = closure S - interior S" -lemma frontier_closed: "closed(frontier S)" +lemma frontier_closed: "closed (frontier S)" by (simp add: frontier_def closed_Diff) lemma frontier_closures: "frontier S = (closure S) \ (closure(- S))" @@ -1196,11 +1341,14 @@ lemma frontier_subset_eq: "frontier S \ S \ closed S" proof- - { assume "frontier S \ S" - hence "closure S \ S" using interior_subset unfolding frontier_def by auto - hence "closed S" using closure_subset_eq by auto + { + assume "frontier S \ S" + then have "closure S \ S" + using interior_subset unfolding frontier_def by auto + then have "closed S" + using closure_subset_eq by auto } - thus ?thesis using frontier_subset_closed[of S] .. + then show ?thesis using frontier_subset_closed[of S] .. qed lemma frontier_complement: "frontier(- S) = frontier S" @@ -1221,7 +1369,7 @@ lemma trivial_limit_within: "trivial_limit (at a within S) \ \ a islimpt S" proof assume "trivial_limit (at a within S)" - thus "\ a islimpt S" + then show "\ a islimpt S" unfolding trivial_limit_def unfolding eventually_at_topological unfolding islimpt_def @@ -1231,7 +1379,7 @@ done next assume "\ a islimpt S" - thus "trivial_limit (at a within S)" + then show "trivial_limit (at a within S)" unfolding trivial_limit_def unfolding eventually_at_topological unfolding islimpt_def @@ -1266,9 +1414,9 @@ lemma eventually_at2: "eventually P (at a) \ (\d>0. \x. 0 < dist x a \ dist x a < d \ P x)" -unfolding eventually_at dist_nz by auto - -lemma eventually_happens: "eventually P net ==> trivial_limit net \ (\x. P x)" + unfolding eventually_at dist_nz by auto + +lemma eventually_happens: "eventually P net \ trivial_limit net \ (\x. P x)" unfolding trivial_limit_def by (auto elim: eventually_rev_mp) @@ -1282,7 +1430,7 @@ lemma eventually_rev_mono: "eventually P net \ (\x. P x \ Q x) \ eventually Q net" -using eventually_mono [of P Q] by fast + using eventually_mono [of P Q] by fast lemma not_eventually: "(\x. \ P x ) \ ~(trivial_limit net) ==> ~(eventually (\x. P x) net)" by (simp add: eventually_False) @@ -1291,7 +1439,7 @@ subsection {* Limits *} lemma Lim: - "(f ---> l) net \ + "(f ---> l) net \ trivial_limit net \ (\e>0. eventually (\x. dist (f x) l < e) net)" unfolding tendsto_iff trivial_limit_eq by auto @@ -1322,7 +1470,8 @@ lemma Lim_within_empty: "(f ---> l) (at x within {})" unfolding tendsto_def eventually_at_filter by simp -lemma Lim_Un: assumes "(f ---> l) (at x within S)" "(f ---> l) (at x within T)" +lemma Lim_Un: + assumes "(f ---> l) (at x within S)" "(f ---> l) (at x within T)" shows "(f ---> l) (at x within (S \ T))" using assms unfolding tendsto_def eventually_at_filter apply clarify @@ -1332,36 +1481,36 @@ done lemma Lim_Un_univ: - "(f ---> l) (at x within S) \ (f ---> l) (at x within T) \ S \ T = UNIV - ==> (f ---> l) (at x)" + "(f ---> l) (at x within S) \ (f ---> l) (at x within T) \ + S \ T = UNIV \ (f ---> l) (at x)" by (metis Lim_Un) text{* Interrelations between restricted and unrestricted limits. *} - lemma Lim_at_within: (* FIXME: rename *) "(f ---> l) (at x) \ (f ---> l) (at x within S)" by (metis order_refl filterlim_mono subset_UNIV at_le) lemma eventually_within_interior: assumes "x \ interior S" - shows "eventually P (at x within S) \ eventually P (at x)" (is "?lhs = ?rhs") -proof - + shows "eventually P (at x within S) \ eventually P (at x)" + (is "?lhs = ?rhs") +proof from assms obtain T where T: "open T" "x \ T" "T \ S" .. - { assume "?lhs" + { + assume "?lhs" then obtain A where "open A" "x \ A" "\y\A. y \ x \ y \ S \ P y" unfolding eventually_at_topological by auto with T have "open (A \ T)" "x \ A \ T" "\y\(A \ T). y \ x \ P y" by auto - then have "?rhs" + then show "?rhs" unfolding eventually_at_topological by auto - } - moreover - { assume "?rhs" hence "?lhs" + next + assume "?rhs" + then show "?lhs" by (auto elim: eventually_elim1 simp: eventually_at_filter) } - ultimately show "?thesis" .. qed lemma at_within_interior: @@ -1379,24 +1528,31 @@ fixes f :: "'a :: {linorder_topology, conditionally_complete_linorder, no_top} \ 'b::{linorder_topology, conditionally_complete_linorder}" assumes mono: "\a b. a \ I \ b \ I \ x < a \ a \ b \ f a \ f b" - assumes bnd: "\a. a \ I \ x < a \ K \ f a" + and bnd: "\a. a \ I \ x < a \ K \ f a" shows "(f ---> Inf (f ` ({x<..} \ I))) (at x within ({x<..} \ I))" proof cases - assume "{x<..} \ I = {}" then show ?thesis by (simp add: Lim_within_empty) + assume "{x<..} \ I = {}" + then show ?thesis by (simp add: Lim_within_empty) next assume e: "{x<..} \ I \ {}" show ?thesis proof (rule order_tendstoI) fix a assume a: "a < Inf (f ` ({x<..} \ I))" - { fix y assume "y \ {x<..} \ I" + { + fix y + assume "y \ {x<..} \ I" with e bnd have "Inf (f ` ({x<..} \ I)) \ f y" by (auto intro: cInf_lower) - with a have "a < f y" by (blast intro: less_le_trans) } + with a have "a < f y" + by (blast intro: less_le_trans) + } then show "eventually (\x. a < f x) (at x within ({x<..} \ I))" by (auto simp: eventually_at_filter intro: exI[of _ 1] zero_less_one) next - fix a assume "Inf (f ` ({x<..} \ I)) < a" - from cInf_lessD[OF _ this] e obtain y where y: "x < y" "y \ I" "f y < a" by auto + fix a + assume "Inf (f ` ({x<..} \ I)) < a" + from cInf_lessD[OF _ this] e obtain y where y: "x < y" "y \ I" "f y < a" + by auto then have "eventually (\x. x \ I \ f x < a) (at_right x)" unfolding eventually_at_right by (metis less_imp_le le_less_trans mono) then show "eventually (\x. f x < a) (at x within ({x<..} \ I))" @@ -1414,27 +1570,33 @@ assume ?lhs from countable_basis_at_decseq[of x] guess A . note A = this def f \ "\n. SOME y. y \ S \ y \ A n \ x \ y" - { fix n + { + fix n from `?lhs` have "\y. y \ S \ y \ A n \ x \ y" unfolding islimpt_def using A(1,2)[of n] by auto then have "f n \ S \ f n \ A n \ x \ f n" unfolding f_def by (rule someI_ex) - then have "f n \ S" "f n \ A n" "x \ f n" by auto } + then have "f n \ S" "f n \ A n" "x \ f n" by auto + } then have "\n. f n \ S - {x}" by auto moreover have "(\n. f n) ----> x" proof (rule topological_tendstoI) - fix S assume "open S" "x \ S" + fix S + assume "open S" "x \ S" from A(3)[OF this] `\n. f n \ A n` - show "eventually (\x. f x \ S) sequentially" by (auto elim!: eventually_elim1) + show "eventually (\x. f x \ S) sequentially" + by (auto elim!: eventually_elim1) qed ultimately show ?rhs by fast next assume ?rhs - then obtain f :: "nat \ 'a" where f: "\n. f n \ S - {x}" and lim: "f ----> x" by auto + then obtain f :: "nat \ 'a" where f: "\n. f n \ S - {x}" and lim: "f ----> x" + by auto show ?lhs unfolding islimpt_def proof safe - fix T assume "open T" "x \ T" + fix T + assume "open T" "x \ T" from lim[THEN topological_tendstoD, OF this] f show "\y\S. y \ T \ y \ x" unfolding eventually_sequentially by auto @@ -1442,8 +1604,10 @@ qed lemma Lim_inv: (* TODO: delete *) - fixes f :: "'a \ real" and A :: "'a filter" - assumes "(f ---> l) A" and "l \ 0" + fixes f :: "'a \ real" + and A :: "'a filter" + assumes "(f ---> l) A" + and "l \ 0" shows "((inverse o f) ---> inverse l) A" unfolding o_def using assms by (rule tendsto_inverse) @@ -1459,13 +1623,14 @@ proof (rule metric_tendsto_imp_tendsto) show "(g ---> 0) net" by fact show "eventually (\x. dist (f x) 0 \ dist (g x) 0) net" - using assms(1) by (rule eventually_elim1, simp add: dist_norm) + using assms(1) by (rule eventually_elim1) (simp add: dist_norm) qed lemma Lim_transform_bound: fixes f :: "'a \ 'b::real_normed_vector" - fixes g :: "'a \ 'c::real_normed_vector" - assumes "eventually (\n. norm(f n) <= norm(g n)) net" "(g ---> 0) net" + and g :: "'a \ 'c::real_normed_vector" + assumes "eventually (\n. norm(f n) <= norm(g n)) net" + and "(g ---> 0) net" shows "(f ---> 0) net" using assms(1) tendsto_norm_zero [OF assms(2)] by (rule Lim_null_comparison) @@ -1473,7 +1638,9 @@ text{* Deducing things about the limit from the elements. *} lemma Lim_in_closed_set: - assumes "closed S" "eventually (\x. f(x) \ S) net" "\(trivial_limit net)" "(f ---> l) net" + assumes "closed S" + and "eventually (\x. f(x) \ S) net" + and "\(trivial_limit net)" "(f ---> l) net" shows "l \ S" proof (rule ccontr) assume "l \ S" @@ -1490,32 +1657,42 @@ text{* Need to prove closed(cball(x,e)) before deducing this as a corollary. *} lemma Lim_dist_ubound: - assumes "\(trivial_limit net)" "(f ---> l) net" "eventually (\x. dist a (f x) <= e) net" + assumes "\(trivial_limit net)" + and "(f ---> l) net" + and "eventually (\x. dist a (f x) <= e) net" shows "dist a l <= e" proof - have "dist a l \ {..e}" proof (rule Lim_in_closed_set) - show "closed {..e}" by simp - show "eventually (\x. dist a (f x) \ {..e}) net" by (simp add: assms) - show "\ trivial_limit net" by fact - show "((\x. dist a (f x)) ---> dist a l) net" by (intro tendsto_intros assms) + show "closed {..e}" + by simp + show "eventually (\x. dist a (f x) \ {..e}) net" + by (simp add: assms) + show "\ trivial_limit net" + by fact + show "((\x. dist a (f x)) ---> dist a l) net" + by (intro tendsto_intros assms) qed - thus ?thesis by simp + then show ?thesis by simp qed lemma Lim_norm_ubound: fixes f :: "'a \ 'b::real_normed_vector" - assumes "\(trivial_limit net)" "(f ---> l) net" "eventually (\x. norm(f x) <= e) net" - shows "norm(l) <= e" + assumes "\(trivial_limit net)" "(f ---> l) net" "eventually (\x. norm(f x) \ e) net" + shows "norm(l) \ e" proof - have "norm l \ {..e}" proof (rule Lim_in_closed_set) - show "closed {..e}" by simp - show "eventually (\x. norm (f x) \ {..e}) net" by (simp add: assms) - show "\ trivial_limit net" by fact - show "((\x. norm (f x)) ---> norm l) net" by (intro tendsto_intros assms) + show "closed {..e}" + by simp + show "eventually (\x. norm (f x) \ {..e}) net" + by (simp add: assms) + show "\ trivial_limit net" + by fact + show "((\x. norm (f x)) ---> norm l) net" + by (intro tendsto_intros assms) qed - thus ?thesis by simp + then show ?thesis by simp qed lemma Lim_norm_lbound: @@ -1525,12 +1702,16 @@ proof - have "norm l \ {e..}" proof (rule Lim_in_closed_set) - show "closed {e..}" by simp - show "eventually (\x. norm (f x) \ {e..}) net" by (simp add: assms) - show "\ trivial_limit net" by fact - show "((\x. norm (f x)) ---> norm l) net" by (intro tendsto_intros assms) + show "closed {e..}" + by simp + show "eventually (\x. norm (f x) \ {e..}) net" + by (simp add: assms) + show "\ trivial_limit net" + by fact + show "((\x. norm (f x)) ---> norm l) net" + by (intro tendsto_intros assms) qed - thus ?thesis by simp + then show ?thesis by simp qed text{* Limit under bilinear function *}