435 then show ?thesis |
435 then show ?thesis |
436 by (simp add: eventually_F) |
436 by (simp add: eventually_F) |
437 qed |
437 qed |
438 |
438 |
439 lemma eventually_INF: "eventually P (INF b:B. F b) \<longleftrightarrow> (\<exists>X\<subseteq>B. finite X \<and> eventually P (INF b:X. F b))" |
439 lemma eventually_INF: "eventually P (INF b:B. F b) \<longleftrightarrow> (\<exists>X\<subseteq>B. finite X \<and> eventually P (INF b:X. F b))" |
440 unfolding INF_def[of B] eventually_Inf[of P "F`B"] |
440 unfolding eventually_Inf [of P "F`B"] |
441 by (metis Inf_image_eq finite_imageI image_mono finite_subset_image) |
441 by (metis finite_imageI image_mono finite_subset_image) |
442 |
442 |
443 lemma Inf_filter_not_bot: |
443 lemma Inf_filter_not_bot: |
444 fixes B :: "'a filter set" |
444 fixes B :: "'a filter set" |
445 shows "(\<And>X. X \<subseteq> B \<Longrightarrow> finite X \<Longrightarrow> Inf X \<noteq> bot) \<Longrightarrow> Inf B \<noteq> bot" |
445 shows "(\<And>X. X \<subseteq> B \<Longrightarrow> finite X \<Longrightarrow> Inf X \<noteq> bot) \<Longrightarrow> Inf B \<noteq> bot" |
446 unfolding trivial_limit_def eventually_Inf[of _ B] |
446 unfolding trivial_limit_def eventually_Inf[of _ B] |
447 bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp |
447 bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp |
448 |
448 |
449 lemma INF_filter_not_bot: |
449 lemma INF_filter_not_bot: |
450 fixes F :: "'i \<Rightarrow> 'a filter" |
450 fixes F :: "'i \<Rightarrow> 'a filter" |
451 shows "(\<And>X. X \<subseteq> B \<Longrightarrow> finite X \<Longrightarrow> (INF b:X. F b) \<noteq> bot) \<Longrightarrow> (INF b:B. F b) \<noteq> bot" |
451 shows "(\<And>X. X \<subseteq> B \<Longrightarrow> finite X \<Longrightarrow> (INF b:X. F b) \<noteq> bot) \<Longrightarrow> (INF b:B. F b) \<noteq> bot" |
452 unfolding trivial_limit_def eventually_INF[of _ B] |
452 unfolding trivial_limit_def eventually_INF [of _ _ B] |
453 bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp |
453 bot_bool_def [symmetric] bot_fun_def [symmetric] bot_unique by simp |
454 |
454 |
455 lemma eventually_Inf_base: |
455 lemma eventually_Inf_base: |
456 assumes "B \<noteq> {}" and base: "\<And>F G. F \<in> B \<Longrightarrow> G \<in> B \<Longrightarrow> \<exists>x\<in>B. x \<le> inf F G" |
456 assumes "B \<noteq> {}" and base: "\<And>F G. F \<in> B \<Longrightarrow> G \<in> B \<Longrightarrow> \<exists>x\<in>B. x \<le> inf F G" |
457 shows "eventually P (Inf B) \<longleftrightarrow> (\<exists>b\<in>B. eventually P b)" |
457 shows "eventually P (Inf B) \<longleftrightarrow> (\<exists>b\<in>B. eventually P b)" |
475 qed (auto intro!: exI[of _ "{x}" for x]) |
475 qed (auto intro!: exI[of _ "{x}" for x]) |
476 |
476 |
477 lemma eventually_INF_base: |
477 lemma eventually_INF_base: |
478 "B \<noteq> {} \<Longrightarrow> (\<And>a b. a \<in> B \<Longrightarrow> b \<in> B \<Longrightarrow> \<exists>x\<in>B. F x \<le> inf (F a) (F b)) \<Longrightarrow> |
478 "B \<noteq> {} \<Longrightarrow> (\<And>a b. a \<in> B \<Longrightarrow> b \<in> B \<Longrightarrow> \<exists>x\<in>B. F x \<le> inf (F a) (F b)) \<Longrightarrow> |
479 eventually P (INF b:B. F b) \<longleftrightarrow> (\<exists>b\<in>B. eventually P (F b))" |
479 eventually P (INF b:B. F b) \<longleftrightarrow> (\<exists>b\<in>B. eventually P (F b))" |
480 unfolding INF_def by (subst eventually_Inf_base) auto |
480 by (subst eventually_Inf_base) auto |
481 |
481 |
482 |
482 |
483 subsubsection \<open>Map function for filters\<close> |
483 subsubsection \<open>Map function for filters\<close> |
484 |
484 |
485 definition filtermap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a filter \<Rightarrow> 'b filter" |
485 definition filtermap :: "('a \<Rightarrow> 'b) \<Rightarrow> 'a filter \<Rightarrow> 'b filter" |
571 lemma inf_principal[simp]: "inf (principal A) (principal B) = principal (A \<inter> B)" |
571 lemma inf_principal[simp]: "inf (principal A) (principal B) = principal (A \<inter> B)" |
572 unfolding filter_eq_iff eventually_inf eventually_principal |
572 unfolding filter_eq_iff eventually_inf eventually_principal |
573 by (auto intro: exI[of _ "\<lambda>x. x \<in> A"] exI[of _ "\<lambda>x. x \<in> B"]) |
573 by (auto intro: exI[of _ "\<lambda>x. x \<in> A"] exI[of _ "\<lambda>x. x \<in> B"]) |
574 |
574 |
575 lemma SUP_principal[simp]: "(SUP i : I. principal (A i)) = principal (\<Union>i\<in>I. A i)" |
575 lemma SUP_principal[simp]: "(SUP i : I. principal (A i)) = principal (\<Union>i\<in>I. A i)" |
576 unfolding filter_eq_iff eventually_Sup SUP_def by (auto simp: eventually_principal) |
576 unfolding filter_eq_iff eventually_Sup by (auto simp: eventually_principal) |
577 |
577 |
578 lemma INF_principal_finite: "finite X \<Longrightarrow> (INF x:X. principal (f x)) = principal (\<Inter>x\<in>X. f x)" |
578 lemma INF_principal_finite: "finite X \<Longrightarrow> (INF x:X. principal (f x)) = principal (\<Inter>x\<in>X. f x)" |
579 by (induct X rule: finite_induct) auto |
579 by (induct X rule: finite_induct) auto |
580 |
580 |
581 lemma filtermap_principal[simp]: "filtermap f (principal A) = principal (f ` A)" |
581 lemma filtermap_principal[simp]: "filtermap f (principal A) = principal (f ` A)" |