definition
gfp :: "[i,i\i]\i" where "gfp(D,h) \ \({X: Pow(D). X \ h(X)})"
text\<open>The theorem is proved in the lattice of subsets of \<^term>\<open>D\<close>,
namely \<^term>\<open>Pow(D)\<close>, with Inter as the greatest lower bound.\<close>
(*This rule yields an induction hypothesis in which the components of a
data structure may be assumed to be elements of lfp(D,h)*) lemma induct: "\bnd_mono(D,h); a \ lfp(D,h); \<And>x. x \<in> h(Collect(lfp(D,h),P)) \<Longrightarrow> P(x) \<rbrakk> \<Longrightarrow> P(a)" apply (rule Collect_is_pre_fixedpt
[THEN lfp_lowerbound, THEN subsetD, THEN CollectD2]) apply (rule_tac [3] lfp_subset [THEN Collect_subset [THEN subset_trans]],
blast+) done
(*Definition form, to control unfolding*) lemma def_induct: "\A \ lfp(D,h); bnd_mono(D,h); a:A; \<And>x. x \<in> h(Collect(A,P)) \<Longrightarrow> P(x) \<rbrakk> \<Longrightarrow> P(a)" by (rule induct, blast+)
(*This version is useful when "A" is not a subset of D
second premise could simply be h(D \<inter> A) \<subseteq> D or \<And>X. X<=D \<Longrightarrow> h(X)<=D *) lemma lfp_Int_lowerbound: "\h(D \ A) \ A; bnd_mono(D,h)\ \ lfp(D,h) \ A" apply (rule lfp_lowerbound [THEN subset_trans]) apply (erule bnd_mono_subset [THEN Int_greatest], blast+) done
(*Monotonicity of lfp, where h precedes i under a domain-like partial order
monotonicity of h is not strictly necessary; h must be bounded by D*) lemma lfp_mono: assumes hmono: "bnd_mono(D,h)" and imono: "bnd_mono(E,i)" and subhi: "\X. X<=D \ h(X) \ i(X)" shows"lfp(D,h) \ lfp(E,i)" apply (rule bnd_monoD1 [THEN lfp_greatest]) apply (rule imono) apply (rule hmono [THEN [2] lfp_Int_lowerbound]) apply (rule Int_lower1 [THEN subhi, THEN subset_trans]) apply (rule imono [THEN bnd_monoD2, THEN subset_trans], auto) done
(*This (unused) version illustrates that monotonicity is not really needed,
but both lfp's must be over the SAME set D; Inter is anti-monotonic!*) lemma lfp_mono2: "\i(D) \ D; \X. X<=D \ h(X) \ i(X)\ \ lfp(D,h) \ lfp(D,i)" apply (rule lfp_greatest, assumption) apply (rule lfp_lowerbound, blast, assumption) done
lemma lfp_cong: "\D=D'; \X. X \ D' \ h(X) = h'(X)\ \ lfp(D,h) = lfp(D',h')" apply (simp add: lfp_def) apply (rule_tac t=Inter in subst_context) apply (rule Collect_cong, simp_all) done
subsection\<open>Proof of Knaster-Tarski Theorem using \<^term>\<open>gfp\<close>\<close>
(*gfp contains each post-fixedpoint that is contained in D*) lemma gfp_upperbound: "\A \ h(A); A<=D\ \ A \ gfp(D,h)" unfolding gfp_def apply (rule PowI [THEN CollectI, THEN Union_upper]) apply (assumption+) done
lemma gfp_subset: "gfp(D,h) \ D" by (unfold gfp_def, blast)
(*Used in datatype package*) lemma def_gfp_subset: "A\gfp(D,h) \ A \ D" apply simp apply (rule gfp_subset) done
(*Definition form, to control unfolding*) lemma def_coinduct: "\A \ gfp(D,h); bnd_mono(D,h); a: X; X \ h(X \ A); X \ D\ \
a \<in> A" apply simp apply (rule coinduct, assumption+) done
(*The version used in the induction/coinduction package*) lemma def_Collect_coinduct: "\A \ gfp(D, \w. Collect(D,P(w))); bnd_mono(D, \w. Collect(D,P(w)));
a: X; X \<subseteq> D; \<And>z. z: X \<Longrightarrow> P(X \<union> A, z)\<rbrakk> \<Longrightarrow>
a \<in> A" apply (rule def_coinduct, assumption+, blast+) done
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.