# HG changeset patch # User hoelzl # Date 1403094692 -7200 # Node ID 49c51eeaa62341381330b2cd4593fd53ebcaf826 # Parent 0ddb5b755cdc7d126fb09cfca57960f740fdadae filters are easier to define with INF on filters. diff -r 0ddb5b755cdc -r 49c51eeaa623 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Wed Jun 18 07:31:12 2014 +0200 +++ b/src/HOL/Limits.thy Wed Jun 18 14:31:32 2014 +0200 @@ -3,7 +3,6 @@ Author: Jacques D. Fleuriot, University of Cambridge Author: Lawrence C Paulson Author: Jeremy Avigad - *) header {* Limits on Real Vector Spaces *} @@ -15,43 +14,27 @@ subsection {* Filter going to infinity norm *} definition at_infinity :: "'a::real_normed_vector filter" where - "at_infinity = Abs_filter (\P. \r. \x. r \ norm x \ P x)" + "at_infinity = (INF r. principal {x. r \ norm x})" -lemma eventually_at_infinity: - "eventually P at_infinity \ (\b. \x. b \ norm x \ P x)" -unfolding at_infinity_def -proof (rule eventually_Abs_filter, rule is_filter.intro) - fix P Q :: "'a \ bool" - assume "\r. \x. r \ norm x \ P x" and "\s. \x. s \ norm x \ Q x" - then obtain r s where - "\x. r \ norm x \ P x" and "\x. s \ norm x \ Q x" by auto - then have "\x. max r s \ norm x \ P x \ Q x" by simp - then show "\r. \x. r \ norm x \ P x \ Q x" .. -qed auto +lemma eventually_at_infinity: "eventually P at_infinity \ (\b. \x. b \ norm x \ P x)" + unfolding at_infinity_def + by (subst eventually_INF_base) + (auto simp: subset_eq eventually_principal intro!: exI[of _ "max a b" for a b]) lemma at_infinity_eq_at_top_bot: "(at_infinity \ real filter) = sup at_top at_bot" - unfolding sup_filter_def at_infinity_def eventually_at_top_linorder eventually_at_bot_linorder -proof (intro arg_cong[where f=Abs_filter] ext iffI) - fix P :: "real \ bool" - assume "\r. \x. r \ norm x \ P x" - then obtain r where "\x. r \ norm x \ P x" .. - then have "(\x\r. P x) \ (\x\-r. P x)" by auto - then show "(\r. \x\r. P x) \ (\r. \x\r. P x)" by auto -next - fix P :: "real \ bool" - assume "(\r. \x\r. P x) \ (\r. \x\r. P x)" - then obtain p q where "\x\p. P x" "\x\q. P x" by auto - then show "\r. \x. r \ norm x \ P x" - by (intro exI[of _ "max p (-q)"]) (auto simp: abs_real_def) -qed + apply (simp add: filter_eq_iff eventually_sup eventually_at_infinity + eventually_at_top_linorder eventually_at_bot_linorder) + apply safe + apply (rule_tac x="b" in exI, simp) + apply (rule_tac x="- b" in exI, simp) + apply (rule_tac x="max (- Na) N" in exI, auto simp: abs_real_def) + done -lemma at_top_le_at_infinity: - "at_top \ (at_infinity :: real filter)" +lemma at_top_le_at_infinity: "at_top \ (at_infinity :: real filter)" unfolding at_infinity_eq_at_top_bot by simp -lemma at_bot_le_at_infinity: - "at_bot \ (at_infinity :: real filter)" +lemma at_bot_le_at_infinity: "at_bot \ (at_infinity :: real filter)" unfolding at_infinity_eq_at_top_bot by simp lemma filterlim_at_top_imp_at_infinity: diff -r 0ddb5b755cdc -r 49c51eeaa623 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Jun 18 07:31:12 2014 +0200 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Wed Jun 18 14:31:32 2014 +0200 @@ -3262,38 +3262,6 @@ text{*Compactness expressed with filters*} -definition "filter_from_subbase B = Abs_filter (\P. \X \ B. finite X \ Inf X \ P)" - -lemma eventually_filter_from_subbase: - "eventually P (filter_from_subbase B) \ (\X \ B. finite X \ Inf X \ P)" - (is "_ \ ?R P") - unfolding filter_from_subbase_def -proof (rule eventually_Abs_filter is_filter.intro)+ - show "?R (\x. True)" - by (rule exI[of _ "{}"]) (simp add: le_fun_def) -next - fix P Q - assume "?R P" then guess X .. - moreover - assume "?R Q" then guess Y .. - ultimately show "?R (\x. P x \ Q x)" - by (intro exI[of _ "X \ Y"]) auto -next - fix P Q - assume "?R P" then guess X .. - moreover assume "\x. P x \ Q x" - ultimately show "?R Q" - by (intro exI[of _ X]) auto -qed - -lemma eventually_filter_from_subbaseI: "P \ B \ eventually P (filter_from_subbase B)" - by (subst eventually_filter_from_subbase) (auto intro!: exI[of _ "{P}"]) - -lemma filter_from_subbase_not_bot: - "\X \ B. finite X \ Inf X \ bot \ filter_from_subbase B \ bot" - unfolding trivial_limit_def eventually_filter_from_subbase - bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp - lemma closure_iff_nhds_not_empty: "x \ closure X \ (\A. \S\A. open S \ x \ S \ X \ A \ {})" proof safe @@ -3360,34 +3328,31 @@ next fix A assume A: "\a\A. closed a" "\B\A. finite B \ U \ \B \ {}" "U \ \A = {}" - def P' \ "(\a (x::'a). x \ a)" - then have inj_P': "\A. inj_on P' A" - by (auto intro!: inj_onI simp: fun_eq_iff) - def F \ "filter_from_subbase (P' ` insert U A)" + def F \ "INF a:insert U A. principal a" have "F \ bot" unfolding F_def - proof (safe intro!: filter_from_subbase_not_bot) - fix X - assume "X \ P' ` insert U A" "finite X" "Inf X = bot" - then obtain B where "B \ insert U A" "finite B" and B: "Inf (P' ` B) = bot" - unfolding subset_image_iff by (auto intro: inj_P' finite_imageD simp del: Inf_image_eq) - with A(2)[THEN spec, of "B - {U}"] have "U \ \(B - {U}) \ {}" + proof (rule INF_filter_not_bot) + fix X assume "X \ insert U A" "finite X" + moreover with A(2)[THEN spec, of "X - {U}"] have "U \ \(X - {U}) \ {}" by auto - with B show False - by (auto simp: P'_def fun_eq_iff) + ultimately show "(INF a:X. principal a) \ bot" + by (auto simp add: INF_principal_finite principal_eq_bot_iff) qed - moreover have "eventually (\x. x \ U) F" - unfolding F_def by (rule eventually_filter_from_subbaseI) (auto simp: P'_def) + moreover + have "F \ principal U" + unfolding F_def by auto + then have "eventually (\x. x \ U) F" + by (auto simp: le_filter_def eventually_principal) moreover assume "\F. F \ bot \ eventually (\x. x \ U) F \ (\x\U. inf (nhds x) F \ bot)" ultimately obtain x where "x \ U" and x: "inf (nhds x) F \ bot" by auto - { - fix V - assume "V \ A" + { fix V assume "V \ A" + then have "F \ principal V" + unfolding F_def by (intro INF_lower2[of V]) auto then have V: "eventually (\x. x \ V) F" - by (auto simp add: F_def image_iff P'_def intro!: eventually_filter_from_subbaseI) + by (auto simp: le_filter_def eventually_principal) have "x \ closure V" unfolding closure_iff_nhds_not_empty proof (intro impI allI) diff -r 0ddb5b755cdc -r 49c51eeaa623 src/HOL/Probability/Measure_Space.thy --- a/src/HOL/Probability/Measure_Space.thy Wed Jun 18 07:31:12 2014 +0200 +++ b/src/HOL/Probability/Measure_Space.thy Wed Jun 18 14:31:32 2014 +0200 @@ -875,40 +875,19 @@ subsection {* The almost everywhere filter (i.e.\ quantifier) *} definition ae_filter :: "'a measure \ 'a filter" where - "ae_filter M = Abs_filter (\P. \N\null_sets M. {x \ space M. \ P x} \ N)" + "ae_filter M = (INF N:null_sets M. principal (space M - N))" -abbreviation - almost_everywhere :: "'a measure \ ('a \ bool) \ bool" where +abbreviation almost_everywhere :: "'a measure \ ('a \ bool) \ bool" where "almost_everywhere M P \ eventually P (ae_filter M)" syntax "_almost_everywhere" :: "pttrn \ 'a \ bool \ bool" ("AE _ in _. _" [0,0,10] 10) translations - "AE x in M. P" == "CONST almost_everywhere M (%x. P)" + "AE x in M. P" == "CONST almost_everywhere M (\x. P)" -lemma eventually_ae_filter: - fixes M P - defines [simp]: "F \ \P. \N\null_sets M. {x \ space M. \ P x} \ N" - shows "eventually P (ae_filter M) \ F P" - unfolding ae_filter_def F_def[symmetric] -proof (rule eventually_Abs_filter) - show "is_filter F" - proof - fix P Q assume "F P" "F Q" - then obtain N L where N: "N \ null_sets M" "{x \ space M. \ P x} \ N" - and L: "L \ null_sets M" "{x \ space M. \ Q x} \ L" - by auto - then have "L \ N \ null_sets M" "{x \ space M. \ (P x \ Q x)} \ L \ N" by auto - then show "F (\x. P x \ Q x)" by auto - next - fix P Q assume "F P" - then obtain N where N: "N \ null_sets M" "{x \ space M. \ P x} \ N" by auto - moreover assume "\x. P x \ Q x" - ultimately have "N \ null_sets M" "{x \ space M. \ Q x} \ N" by auto - then show "F Q" by auto - qed auto -qed +lemma eventually_ae_filter: "eventually P (ae_filter M) \ (\N\null_sets M. {x \ space M. \ P x} \ N)" + unfolding ae_filter_def by (subst eventually_INF_base) (auto simp: eventually_principal subset_eq) lemma AE_I': "N \ null_sets M \ {x\space M. \ P x} \ N \ (AE x in M. P x)" diff -r 0ddb5b755cdc -r 49c51eeaa623 src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Wed Jun 18 07:31:12 2014 +0200 +++ b/src/HOL/Real_Vector_Spaces.thy Wed Jun 18 14:31:32 2014 +0200 @@ -1862,3 +1862,4 @@ qed end + diff -r 0ddb5b755cdc -r 49c51eeaa623 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Wed Jun 18 07:31:12 2014 +0200 +++ b/src/HOL/Topological_Spaces.thy Wed Jun 18 14:31:32 2014 +0200 @@ -530,6 +530,86 @@ lemma eventually_const: "\ trivial_limit net \ eventually (\x. P) net \ P" by (cases P) (simp_all add: eventually_False) +lemma eventually_Inf: "eventually P (Inf B) \ (\X\B. finite X \ eventually P (Inf X))" +proof - + let ?F = "\P. \X\B. finite X \ eventually P (Inf X)" + + { fix P have "eventually P (Abs_filter ?F) \ ?F P" + proof (rule eventually_Abs_filter is_filter.intro)+ + show "?F (\x. True)" + by (rule exI[of _ "{}"]) (simp add: le_fun_def) + next + fix P Q + assume "?F P" then guess X .. + moreover + assume "?F Q" then guess Y .. + ultimately show "?F (\x. P x \ Q x)" + by (intro exI[of _ "X \ Y"]) + (auto simp: Inf_union_distrib eventually_inf) + next + fix P Q + assume "?F P" then guess X .. + moreover assume "\x. P x \ Q x" + ultimately show "?F Q" + by (intro exI[of _ X]) (auto elim: eventually_elim1) + qed } + note eventually_F = this + + have "Inf B = Abs_filter ?F" + proof (intro antisym Inf_greatest) + show "Inf B \ Abs_filter ?F" + by (auto simp: le_filter_def eventually_F dest: Inf_superset_mono) + next + fix F assume "F \ B" then show "Abs_filter ?F \ F" + by (auto simp add: le_filter_def eventually_F intro!: exI[of _ "{F}"]) + qed + then show ?thesis + by (simp add: eventually_F) +qed + +lemma eventually_INF: "eventually P (INF b:B. F b) \ (\X\B. finite X \ eventually P (INF b:X. F b))" + unfolding INF_def[of B] eventually_Inf[of P "F`B"] + by (metis Inf_image_eq finite_imageI image_mono finite_subset_image) + +lemma Inf_filter_not_bot: + fixes B :: "'a filter set" + shows "(\X. X \ B \ finite X \ Inf X \ bot) \ Inf B \ bot" + unfolding trivial_limit_def eventually_Inf[of _ B] + bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp + +lemma INF_filter_not_bot: + fixes F :: "'i \ 'a filter" + shows "(\X. X \ B \ finite X \ (INF b:X. F b) \ bot) \ (INF b:B. F b) \ bot" + unfolding trivial_limit_def eventually_INF[of _ B] + bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp + +lemma eventually_Inf_base: + assumes "B \ {}" and base: "\F G. F \ B \ G \ B \ \x\B. x \ inf F G" + shows "eventually P (Inf B) \ (\b\B. eventually P b)" +proof (subst eventually_Inf, safe) + fix X assume "finite X" "X \ B" + then have "\b\B. \x\X. b \ x" + proof induct + case empty then show ?case + using `B \ {}` by auto + next + case (insert x X) + then obtain b where "b \ B" "\x. x \ X \ b \ x" + by auto + with `insert x X \ B` base[of b x] show ?case + by (auto intro: order_trans) + qed + then obtain b where "b \ B" "b \ Inf X" + by (auto simp: le_Inf_iff) + then show "eventually P (Inf X) \ Bex B (eventually P)" + by (intro bexI[of _ b]) (auto simp: le_filter_def) +qed (auto intro!: exI[of _ "{x}" for x]) + +lemma eventually_INF_base: + "B \ {} \ (\a b. a \ B \ b \ B \ \x\B. F x \ inf (F a) (F b)) \ + eventually P (INF b:B. F b) \ (\b\B. eventually P (F b))" + unfolding INF_def by (subst eventually_Inf_base) auto + subsubsection {* Map function for filters *} @@ -560,124 +640,26 @@ lemma filtermap_sup: "filtermap f (sup F1 F2) = sup (filtermap f F1) (filtermap f F2)" by (auto simp: filter_eq_iff eventually_filtermap eventually_sup) -subsubsection {* Order filters *} - -definition at_top :: "('a::order) filter" - where "at_top = Abs_filter (\P. \k. \n\k. P n)" - -lemma eventually_at_top_linorder: "eventually P at_top \ (\N::'a::linorder. \n\N. P n)" - unfolding at_top_def -proof (rule eventually_Abs_filter, rule is_filter.intro) - fix P Q :: "'a \ bool" - assume "\i. \n\i. P n" and "\j. \n\j. Q n" - then obtain i j where "\n\i. P n" and "\n\j. Q n" by auto - then have "\n\max i j. P n \ Q n" by simp - then show "\k. \n\k. P n \ Q n" .. -qed auto - -lemma eventually_ge_at_top: - "eventually (\x. (c::_::linorder) \ x) at_top" - unfolding eventually_at_top_linorder by auto - -lemma eventually_at_top_dense: "eventually P at_top \ (\N::'a::unbounded_dense_linorder. \n>N. P n)" - unfolding eventually_at_top_linorder -proof safe - fix N assume "\n\N. P n" - then show "\N. \n>N. P n" by (auto intro!: exI[of _ N]) -next - fix N assume "\n>N. P n" - moreover obtain y where "N < y" using gt_ex[of N] .. - ultimately show "\N. \n\N. P n" by (auto intro!: exI[of _ y]) +lemma filtermap_inf: "filtermap f (inf F1 F2) \ inf (filtermap f F1) (filtermap f F2)" + by (auto simp: le_filter_def eventually_filtermap eventually_inf) + +lemma filtermap_INF: "filtermap f (INF b:B. F b) \ (INF b:B. filtermap f (F b))" +proof - + { fix X :: "'c set" assume "finite X" + then have "filtermap f (INFIMUM X F) \ (INF b:X. filtermap f (F b))" + proof induct + case (insert x X) + have "filtermap f (INF a:insert x X. F a) \ inf (filtermap f (F x)) (filtermap f (INF a:X. F a))" + by (rule order_trans[OF _ filtermap_inf]) simp + also have "\ \ inf (filtermap f (F x)) (INF a:X. filtermap f (F a))" + by (intro inf_mono insert order_refl) + finally show ?case + by simp + qed simp } + then show ?thesis + unfolding le_filter_def eventually_filtermap + by (subst (1 2) eventually_INF) auto qed - -lemma eventually_gt_at_top: - "eventually (\x. (c::_::unbounded_dense_linorder) < x) at_top" - unfolding eventually_at_top_dense by auto - -definition at_bot :: "('a::order) filter" - where "at_bot = Abs_filter (\P. \k. \n\k. P n)" - -lemma eventually_at_bot_linorder: - fixes P :: "'a::linorder \ bool" shows "eventually P at_bot \ (\N. \n\N. P n)" - unfolding at_bot_def -proof (rule eventually_Abs_filter, rule is_filter.intro) - fix P Q :: "'a \ bool" - assume "\i. \n\i. P n" and "\j. \n\j. Q n" - then obtain i j where "\n\i. P n" and "\n\j. Q n" by auto - then have "\n\min i j. P n \ Q n" by simp - then show "\k. \n\k. P n \ Q n" .. -qed auto - -lemma eventually_le_at_bot: - "eventually (\x. x \ (c::_::linorder)) at_bot" - unfolding eventually_at_bot_linorder by auto - -lemma eventually_at_bot_dense: - fixes P :: "'a::unbounded_dense_linorder \ bool" shows "eventually P at_bot \ (\N. \nn\N. P n" then show "\N. \nnN. \n\N. P n" by (auto intro!: exI[of _ y]) -qed - -lemma eventually_gt_at_bot: - "eventually (\x. x < (c::_::unbounded_dense_linorder)) at_bot" - unfolding eventually_at_bot_dense by auto - -lemma trivial_limit_at_bot_linorder: "\ trivial_limit (at_bot ::('a::linorder) filter)" - unfolding trivial_limit_def - by (metis eventually_at_bot_linorder order_refl) - -lemma trivial_limit_at_top_linorder: "\ trivial_limit (at_top ::('a::linorder) filter)" - unfolding trivial_limit_def - by (metis eventually_at_top_linorder order_refl) - -subsection {* Sequentially *} - -abbreviation sequentially :: "nat filter" - where "sequentially == at_top" - -lemma sequentially_def: "sequentially = Abs_filter (\P. \k. \n\k. P n)" - unfolding at_top_def by simp - -lemma eventually_sequentially: - "eventually P sequentially \ (\N. \n\N. P n)" - by (rule eventually_at_top_linorder) - -lemma sequentially_bot [simp, intro]: "sequentially \ bot" - unfolding filter_eq_iff eventually_sequentially by auto - -lemmas trivial_limit_sequentially = sequentially_bot - -lemma eventually_False_sequentially [simp]: - "\ eventually (\n. False) sequentially" - by (simp add: eventually_False) - -lemma le_sequentially: - "F \ sequentially \ (\N. eventually (\n. N \ n) F)" - unfolding le_filter_def eventually_sequentially - by (safe, fast, drule_tac x=N in spec, auto elim: eventually_rev_mp) - -lemma eventually_sequentiallyI: - assumes "\x. c \ x \ P x" - shows "eventually P sequentially" -using assms by (auto simp: eventually_sequentially) - -lemma eventually_sequentially_seg: - "eventually (\n. P (n + k)) sequentially \ eventually P sequentially" - unfolding eventually_sequentially - apply safe - apply (rule_tac x="N + k" in exI) - apply rule - apply (erule_tac x="n - k" in allE) - apply auto [] - apply (rule_tac x=N in exI) - apply auto [] - done - subsubsection {* Standard filters *} definition principal :: "'a set \ 'a filter" where @@ -696,6 +678,9 @@ lemma principal_empty[simp]: "principal {} = bot" by (auto simp: filter_eq_iff eventually_principal) +lemma principal_eq_bot_iff: "principal X = bot \ X = {}" + by (auto simp add: filter_eq_iff eventually_principal) + lemma principal_le_iff[iff]: "principal A \ principal B \ A \ B" by (auto simp: le_filter_def eventually_principal) @@ -719,13 +704,122 @@ lemma SUP_principal[simp]: "(SUP i : I. principal (A i)) = principal (\i\I. A i)" unfolding filter_eq_iff eventually_Sup SUP_def by (auto simp: eventually_principal) +lemma INF_principal_finite: "finite X \ (INF x:X. principal (f x)) = principal (\x\X. f x)" + by (induct X rule: finite_induct) auto + lemma filtermap_principal[simp]: "filtermap f (principal A) = principal (f ` A)" unfolding filter_eq_iff eventually_filtermap eventually_principal by simp +subsubsection {* Order filters *} + +definition at_top :: "('a::order) filter" + where "at_top = (INF k. principal {k ..})" + +lemma eventually_at_top_linorder: "eventually P at_top \ (\N::'a::linorder. \n\N. P n)" + unfolding at_top_def + by (subst eventually_INF_base) (auto simp: eventually_principal intro: max.cobounded1 max.cobounded2) + +lemma eventually_ge_at_top: + "eventually (\x. (c::_::linorder) \ x) at_top" + unfolding eventually_at_top_linorder by auto + +lemma (in linorder) Ici_subset_Ioi_iff: "{a ..} \ {b <..} \ b < a" + by auto + +lemma (in linorder) Iic_subset_Iio_iff: "{.. a} \ {..< b} \ a < b" + by auto + +lemma eventually_at_top_dense: "eventually P at_top \ (\N::'a::{no_top, linorder}. \n>N. P n)" +proof - + have "eventually P (INF k. principal {k <..}) \ (\N::'a. \n>N. P n)" + by (subst eventually_INF_base) (auto simp: eventually_principal intro: max.cobounded1 max.cobounded2) + also have "(INF k. principal {k::'a <..}) = at_top" + unfolding at_top_def + by (intro INF_eq) (auto intro: less_imp_le simp: Ici_subset_Ioi_iff gt_ex) + finally show ?thesis . +qed + +lemma eventually_gt_at_top: + "eventually (\x. (c::_::unbounded_dense_linorder) < x) at_top" + unfolding eventually_at_top_dense by auto + +definition at_bot :: "('a::order) filter" + where "at_bot = (INF k. principal {.. k})" + +lemma eventually_at_bot_linorder: + fixes P :: "'a::linorder \ bool" shows "eventually P at_bot \ (\N. \n\N. P n)" + unfolding at_bot_def + by (subst eventually_INF_base) (auto simp: eventually_principal intro: min.cobounded1 min.cobounded2) + +lemma eventually_le_at_bot: + "eventually (\x. x \ (c::_::linorder)) at_bot" + unfolding eventually_at_bot_linorder by auto + +lemma eventually_at_bot_dense: "eventually P at_bot \ (\N::'a::{no_bot, linorder}. \n (\N::'a. \nx. x < (c::_::unbounded_dense_linorder)) at_bot" + unfolding eventually_at_bot_dense by auto + +lemma trivial_limit_at_bot_linorder: "\ trivial_limit (at_bot ::('a::linorder) filter)" + unfolding trivial_limit_def + by (metis eventually_at_bot_linorder order_refl) + +lemma trivial_limit_at_top_linorder: "\ trivial_limit (at_top ::('a::linorder) filter)" + unfolding trivial_limit_def + by (metis eventually_at_top_linorder order_refl) + +subsection {* Sequentially *} + +abbreviation sequentially :: "nat filter" + where "sequentially \ at_top" + +lemma eventually_sequentially: + "eventually P sequentially \ (\N. \n\N. P n)" + by (rule eventually_at_top_linorder) + +lemma sequentially_bot [simp, intro]: "sequentially \ bot" + unfolding filter_eq_iff eventually_sequentially by auto + +lemmas trivial_limit_sequentially = sequentially_bot + +lemma eventually_False_sequentially [simp]: + "\ eventually (\n. False) sequentially" + by (simp add: eventually_False) + +lemma le_sequentially: + "F \ sequentially \ (\N. eventually (\n. N \ n) F)" + by (simp add: at_top_def le_INF_iff le_principal) + +lemma eventually_sequentiallyI: + assumes "\x. c \ x \ P x" + shows "eventually P sequentially" +using assms by (auto simp: eventually_sequentially) + +lemma eventually_sequentially_seg: + "eventually (\n. P (n + k)) sequentially \ eventually P sequentially" + unfolding eventually_sequentially + apply safe + apply (rule_tac x="N + k" in exI) + apply rule + apply (erule_tac x="n - k" in allE) + apply auto [] + apply (rule_tac x=N in exI) + apply auto [] + done + subsubsection {* Topological filters *} definition (in topological_space) nhds :: "'a \ 'a filter" - where "nhds a = Abs_filter (\P. \S. open S \ a \ S \ (\x\S. P x))" + where "nhds a = (INF S:{S. open S \ a \ S}. principal S)" definition (in topological_space) at_within :: "'a \ 'a set \ 'a filter" ("at (_) within (_)" [1000, 60] 60) where "at a within s = inf (nhds a) (principal (s - {a}))" @@ -741,21 +835,7 @@ lemma (in topological_space) eventually_nhds: "eventually P (nhds a) \ (\S. open S \ a \ S \ (\x\S. P x))" - unfolding nhds_def -proof (rule eventually_Abs_filter, rule is_filter.intro) - have "open UNIV \ a \ UNIV \ (\x\UNIV. True)" by simp - thus "\S. open S \ a \ S \ (\x\S. True)" .. -next - fix P Q - assume "\S. open S \ a \ S \ (\x\S. P x)" - and "\T. open T \ a \ T \ (\x\T. Q x)" - then obtain S T where - "open S \ a \ S \ (\x\S. P x)" - "open T \ a \ T \ (\x\T. Q x)" by auto - hence "open (S \ T) \ a \ S \ T \ (\x\(S \ T). P x \ Q x)" - by (simp add: open_Int) - thus "\S. open S \ a \ S \ (\x\S. P x \ Q x)" .. -qed auto + unfolding nhds_def by (subst eventually_INF_base) (auto simp: eventually_principal) lemma nhds_neq_bot [simp]: "nhds a \ bot" unfolding trivial_limit_def eventually_nhds by simp @@ -893,6 +973,10 @@ "(LIM x F1. f x :> inf F2 F3) \ ((LIM x F1. f x :> F2) \ (LIM x F1. f x :> F3))" unfolding filterlim_def by simp +lemma filterlim_INF: + "(LIM x F. f x :> (INF b:B. G b)) \ (\b\B. LIM x F. f x :> G b)" + unfolding filterlim_def le_INF_iff .. + lemma filterlim_filtermap: "filterlim f F1 (filtermap g F2) = filterlim (\x. f (g x)) F1 F2" unfolding filterlim_def filtermap_filtermap .. @@ -933,13 +1017,7 @@ lemma (in topological_space) tendsto_def: "(f ---> l) F \ (\S. open S \ l \ S \ eventually (\x. f x \ S) F)" - unfolding filterlim_def -proof safe - fix S assume "open S" "l \ S" "filtermap f F \ nhds l" - then show "eventually (\x. f x \ S) F" - unfolding eventually_nhds eventually_filtermap le_filter_def - by (auto elim!: allE[of _ "\x. x \ S"] eventually_rev_mp) -qed (auto elim!: eventually_rev_mp simp: eventually_nhds eventually_filtermap le_filter_def) + unfolding nhds_def filterlim_INF filterlim_principal by auto lemma tendsto_mono: "F \ F' \ (f ---> l) F' \ (f ---> l) F" unfolding tendsto_def le_filter_def by fast @@ -1120,7 +1198,7 @@ subsubsection {* Rules about @{const Lim} *} -lemma (in t2_space) tendsto_Lim: +lemma tendsto_Lim: "\(trivial_limit net) \ (f ---> l) net \ Lim net f = l" unfolding Lim_def using tendsto_unique[of net f] by auto @@ -1565,9 +1643,7 @@ unfolding convergent_def by (auto intro: LIMSEQ_subseq_LIMSEQ) lemma limI: "X ----> L ==> lim X = L" -apply (simp add: lim_def) -apply (blast intro: LIMSEQ_unique) -done + by (rule tendsto_Lim) (rule trivial_limit_sequentially) lemma lim_le: "convergent f \ (\n. f n \ (x::'a::linorder_topology)) \ lim f \ x" using LIMSEQ_le_const2[of f "lim f" x] by (simp add: convergent_LIMSEQ_iff) @@ -1767,6 +1843,7 @@ fix X assume X: "\n. X n \ {.. X n \ a" "X ----> a" show "eventually (\n. P (X n)) sequentially" proof (rule ccontr) + assume "\ eventually (\n. P (X n)) sequentially" from not_eventually_sequentiallyD[OF this] obtain r where "subseq r" "\n. \ P (X (r n))"