src/HOL/ex/Tarski.thy
changeset 70202 373eb0aa97e3
parent 70194 da497279f492
equal deleted inserted replaced
70201:2e496190039d 70202:373eb0aa97e3
   442     ultimately show ?thesis
   442     ultimately show ?thesis
   443       using po.transE by blast
   443       using po.transE by blast
   444   qed
   444   qed
   445 qed
   445 qed
   446 
   446 
   447 lemma flubH_le_lubH: 
   447 lemma lubH_is_fixp: 
   448   assumes "H = {x \<in> A. (x, f x) \<in> r}"
   448   assumes "H = {x \<in> A. (x, f x) \<in> r}"
   449   shows "(f (lub H cl), lub H cl) \<in> r"
   449   shows "lub H cl \<in> fix f A"
   450 proof -
   450 proof -
   451   have "(lub H cl, f (lub H cl)) \<in> r"
   451   have "(f (lub H cl), lub H cl) \<in> r"
   452     using assms lubH_le_flubH by blast
   452   proof -
   453   then have "(f (lub H cl), f (f (lub H cl))) \<in> r"
   453     have "(lub H cl, f (lub H cl)) \<in> r"
   454     by (meson PO_imp_refl_on monotoneE monotone_f refl_on_domain)
   454       using assms lubH_le_flubH by blast
   455   then have "f (lub H cl) \<in> H"
   455     then have "(f (lub H cl), f (f (lub H cl))) \<in> r"
   456     by (metis (no_types, lifting) PO_imp_refl_on assms mem_Collect_eq refl_on_domain)
   456       by (meson PO_imp_refl_on monotoneE monotone_f refl_on_domain)
   457   then show ?thesis
   457     then have "f (lub H cl) \<in> H"
   458     by (simp add: assms lub_upper)
   458       by (metis (no_types, lifting) PO_imp_refl_on assms mem_Collect_eq refl_on_domain)
   459 qed
   459     then show ?thesis
   460 
   460       by (simp add: assms lub_upper)
   461 
   461   qed
   462 
   462   with assms show ?thesis
   463 lemma lubH_is_fixp: "H = {x \<in> A. (x, f x) \<in> r} \<Longrightarrow> lub H cl \<in> fix f A"
   463     by (simp add: fix_def antisymE lubH_le_flubH lub_in_lattice)
   464   by (simp add: fix_def antisymE flubH_le_lubH lubH_le_flubH lub_in_lattice)
   464 qed
   465 
   465 
   466 lemma fix_in_H: "\<lbrakk>H = {x \<in> A. (x, f x) \<in> r}; x \<in> P\<rbrakk> \<Longrightarrow> x \<in> H"
   466 lemma fixf_le_lubH: 
   467   by (simp add: P_def fix_imp_eq [of _ f A] reflE fix_subset [of f A, THEN subsetD])
   467   assumes "H = {x \<in> A. (x, f x) \<in> r}" "x \<in> fix f A"
   468 
   468   shows "(x, lub H cl) \<in> r"
   469 lemma fixf_le_lubH: "H = {x \<in> A. (x, f x) \<in> r} \<Longrightarrow> \<forall>x \<in> fix f A. (x, lub H cl) \<in> r"
   469 proof -
   470   by (metis (no_types, lifting) P_def fix_in_H lub_upper mem_Collect_eq subset_eq)
   470   have "x \<in> P \<Longrightarrow> x \<in> H"
   471 
   471     by (simp add: assms P_def fix_imp_eq [of _ f A] reflE fix_subset [of f A, THEN subsetD])
   472 lemma lubH_least_fixf:
   472   with assms show ?thesis
   473   "H = {x \<in> A. (x, f x) \<in> r} \<Longrightarrow> \<forall>L. (\<forall>y \<in> fix f A. (y,L) \<in> r) \<longrightarrow> (lub H cl, L) \<in> r"
   473     by (metis (no_types, lifting) P_def lub_upper mem_Collect_eq subset_eq)
   474   using lubH_is_fixp by blast
   474 qed
   475 
   475 
   476 
   476 
   477 subsection \<open>Tarski fixpoint theorem 1, first part\<close>
   477 subsection \<open>Tarski fixpoint theorem 1, first part\<close>
   478 
   478 
   479 lemma T_thm_1_lub: "lub P cl = lub {x \<in> A. (x, f x) \<in> r} cl"
   479 lemma T_thm_1_lub: "lub P cl = lub {x \<in> A. (x, f x) \<in> r} cl"
   621 
   621 
   622 lemma Bot_intv_not_empty: "x \<in> A \<Longrightarrow> interval r (Bot cl) x \<noteq> {}"
   622 lemma Bot_intv_not_empty: "x \<in> A \<Longrightarrow> interval r (Bot cl) x \<noteq> {}"
   623   using Bot_dual_Top Bot_prop intervalI reflE by fastforce
   623   using Bot_dual_Top Bot_prop intervalI reflE by fastforce
   624 
   624 
   625 
   625 
   626 subsection \<open>fixed points form a partial order\<close>
   626 text \<open>the set of fixed points form a partial order\<close>
   627 
   627 proposition fixf_po: "\<lparr>pset = P, order = induced P r\<rparr> \<in> PartialOrder"
   628 lemma fixf_po: "\<lparr>pset = P, order = induced P r\<rparr> \<in> PartialOrder"
       
   629   by (simp add: P_def fix_subset po_subset_po)
   628   by (simp add: P_def fix_subset po_subset_po)
   630 
   629 
   631 end
   630 end
   632 
   631 
   633 context Tarski
   632 context Tarski
   721 qed
   720 qed
   722 
   721 
   723 end
   722 end
   724 
   723 
   725 lemma CompleteLatticeI_simp:
   724 lemma CompleteLatticeI_simp:
   726   "\<lbrakk>po \<in> PartialOrder; \<And>S. S \<subseteq> A \<Longrightarrow> \<exists>L. isLub S po  L; A = pset po\<rbrakk>
   725   "\<lbrakk>po \<in> PartialOrder; \<And>S. S \<subseteq> A \<Longrightarrow> \<exists>L. isLub S po  L; A = pset po\<rbrakk> \<Longrightarrow> po \<in> CompleteLattice"
   727     \<Longrightarrow> po \<in> CompleteLattice"
       
   728   by (metis CompleteLatticeI Rdual)
   726   by (metis CompleteLatticeI Rdual)
   729 
       
   730 
   727 
   731 theorem (in CLF) Tarski_full: "\<lparr>pset = P, order = induced P r\<rparr> \<in> CompleteLattice"
   728 theorem (in CLF) Tarski_full: "\<lparr>pset = P, order = induced P r\<rparr> \<in> CompleteLattice"
   732 proof (intro CompleteLatticeI_simp allI impI)
   729 proof (intro CompleteLatticeI_simp allI impI)
   733   show "\<lparr>pset = P, order = induced P r\<rparr> \<in> PartialOrder"
   730   show "\<lparr>pset = P, order = induced P r\<rparr> \<in> PartialOrder"
   734     by (simp add: fixf_po)
   731     by (simp add: fixf_po)