theory lfp imports Main begin locale L = fixes f :: "'a \ 'a \ bool" begin inductive_set X where X_intro: "\ \b. f a b \ b \ X \ \ a \ X" definition X_step where [simp]: "X_step S \ S \ {a. \b. f a b \ b \ S}" definition X_lfp where "X_lfp \ lfp X_step" lemma X_step_mono: "mono X_step" by (rule monoI) auto lemma X_lfp_equiv: "X = X_lfp" proof show "X \ X_lfp" proof fix x assume "x \ X" thus "x \ X_lfp" proof (induct) case (X_intro a) have "a \ X_step X_lfp" unfolding X_step_def using X_intro(2) by auto thus ?case unfolding X_lfp_def using X_step_mono lfp_unfold by blast qed qed show "X_lfp \ X" unfolding X_lfp_def using X_step_mono by (rule lfp_ordinal_induct_set) (auto intro: X_intro Sup_le_iff) qed lemma X_lfp_induct: assumes step: "\S. P S \ P (S \ {a. \b. f a b \ b \ S})" and union: "\M. \S \ M. P S \ P (\M)" shows "P X" proof (subst X_lfp_equiv, unfold X_lfp_def, rule lfp_ordinal_induct_set) show "\S. P S \ P (X_step S)" using step by auto qed (insert X_step_mono union) end end