# HG changeset patch # User huffman # Date 1131232923 -3600 # Node ID 4328356ab7e67e53a72483dce320ccf3f6da98d2 # Parent 404f298220afe08e628f13d1624da69852052cfd add proof of Bekic's theorem: fix_cprod diff -r 404f298220af -r 4328356ab7e6 src/HOLCF/Fix.thy --- a/src/HOLCF/Fix.thy Sat Nov 05 21:56:45 2005 +0100 +++ b/src/HOLCF/Fix.thy Sun Nov 06 00:22:03 2005 +0100 @@ -108,9 +108,7 @@ lemma fix_eqI: "\F\x = x; \z. F\z = z \ x \ z\ \ x = fix\F" apply (rule antisym_less) -apply (erule allE) -apply (erule mp) -apply (rule fix_eq [symmetric]) +apply (simp add: fix_eq [symmetric]) apply (erule fix_least) done @@ -190,6 +188,38 @@ "Letrec xs = a in \e,es\" == "CLetrec\(\ xs. \a,e,es\)" "Letrec xs = a in e" == "CLetrec\(\ xs. \a,e\)" +text {* + Bekic's Theorem: Simultaneous fixed points over pairs + can be written in terms of separate fixed points. +*} + +lemma fix_cprod: + "fix\(F::'a \ 'b \ 'a \ 'b) = + \\ x. cfst\(F\\x, \ y. csnd\(F\\x, y\)\), + \ y. csnd\(F\\\ x. cfst\(F\\x, \ y. csnd\(F\\x, y\)\), y\)\" + (is "fix\F = \?x, ?y\") +proof (rule fix_eqI [rule_format, symmetric]) + have 1: "cfst\(F\\?x, ?y\) = ?x" + by (rule trans [symmetric, OF fix_eq], simp) + have 2: "csnd\(F\\?x, ?y\) = ?y" + by (rule trans [symmetric, OF fix_eq], simp) + from 1 2 show "F\\?x, ?y\ = \?x, ?y\" by (simp add: eq_cprod) +next + fix z assume F_z: "F\z = z" + then obtain x y where z: "z = \x,y\" by (rule_tac p=z in cprodE) + from F_z z have F_x: "cfst\(F\\x, y\) = x" by simp + from F_z z have F_y: "csnd\(F\\x, y\) = y" by simp + let ?y1 = "\ y. csnd\(F\\x, y\)" + have "?y1 \ y" by (rule fix_least, simp add: F_y) + hence "cfst\(F\\x, ?y1\) \ cfst\(F\\x, y\)" by (simp add: monofun_cfun) + hence "cfst\(F\\x, ?y1\) \ x" using F_x by simp + hence 1: "?x \ x" by (simp add: fix_least_less) + hence "csnd\(F\\?x, y\) \ csnd\(F\\x, y\)" by (simp add: monofun_cfun) + hence "csnd\(F\\?x, y\) \ y" using F_y by simp + hence 2: "?y \ y" by (simp add: fix_least_less) + show "\?x, ?y\ \ z" using z 1 2 by simp +qed + subsection {* Weak admissibility *} constdefs