# HG changeset patch # User huffman # Date 1118187639 -7200 # Node ID 1ff2965cc2e7f82dc4f2f1cb6785c983551e0c00 # Parent 45b12a01382fef1e4c9babdfae986922b5938aea major cleanup: rewrote cpo proofs, removed obsolete lemmas, renamed some lemmas diff -r 45b12a01382f -r 1ff2965cc2e7 src/HOLCF/Up.ML --- a/src/HOLCF/Up.ML Wed Jun 08 00:59:46 2005 +0200 +++ b/src/HOLCF/Up.ML Wed Jun 08 01:40:39 2005 +0200 @@ -4,59 +4,28 @@ val Iup_def = thm "Iup_def"; val Ifup_def = thm "Ifup_def"; val less_up_def = thm "less_up_def"; -val Abs_Up_inverse2 = thm "Abs_Up_inverse2"; -val Exh_Up = thm "Exh_Up"; -val inj_Abs_Up = thm "inj_Abs_Up"; -val inj_Rep_Up = thm "inj_Rep_Up"; -val inject_Iup = thm "inject_Iup"; -val defined_Iup = thm "defined_Iup"; -val upE = thm "upE"; val Ifup1 = thm "Ifup1"; val Ifup2 = thm "Ifup2"; -val less_up1a = thm "less_up1a"; -val less_up1b = thm "less_up1b"; -val less_up1c = thm "less_up1c"; val refl_less_up = thm "refl_less_up"; val antisym_less_up = thm "antisym_less_up"; val trans_less_up = thm "trans_less_up"; -val inst_up_po = thm "inst_up_po"; val minimal_up = thm "minimal_up"; -val UU_up_def = thm "UU_up_def"; val least_up = thm "least_up"; -val less_up2b = thm "less_up2b"; -val less_up2c = thm "less_up2c"; -val monofun_Iup = thm "monofun_Iup"; -val monofun_Ifup1 = thm "monofun_Ifup1"; val monofun_Ifup2 = thm "monofun_Ifup2"; val up_lemma1 = thm "up_lemma1"; -val lub_up1a = thm "lub_up1a"; -val lub_up1b = thm "lub_up1b"; -val thelub_up1a = thm "thelub_up1a"; -val thelub_up1b = thm "thelub_up1b"; val cpo_up = thm "cpo_up"; val up_def = thm "up_def"; val fup_def = thm "fup_def"; val inst_up_pcpo = thm "inst_up_pcpo"; -val less_up3b = thm "less_up3b"; -val defined_Iup2 = thm "defined_Iup2"; -val contlub_Iup = thm "contlub_Iup"; val cont_Iup = thm "cont_Iup"; -val contlub_Ifup1 = thm "contlub_Ifup1"; -val contlub_Ifup2 = thm "contlub_Ifup2"; val cont_Ifup1 = thm "cont_Ifup1"; val cont_Ifup2 = thm "cont_Ifup2"; val Exh_Up1 = thm "Exh_Up1"; -val inject_up = thm "inject_up"; -val defined_up = thm "defined_up"; +val up_inject = thm "up_inject"; +val up_eq = thm "up_eq"; +val up_defined = thm "up_defined"; +val up_less = thm "up_less"; val upE1 = thm "upE1"; val fup1 = thm "fup1"; val fup2 = thm "fup2"; -val less_up4b = thm "less_up4b"; -val less_up4c = thm "less_up4c"; -val thelub_up2a = thm "thelub_up2a"; -val thelub_up2b = thm "thelub_up2b"; -val up_lemma2 = thm "up_lemma2"; -val thelub_up2a_rev = thm "thelub_up2a_rev"; -val thelub_up2b_rev = thm "thelub_up2b_rev"; -val thelub_up3 = thm "thelub_up3"; val fup3 = thm "fup3"; diff -r 45b12a01382f -r 1ff2965cc2e7 src/HOLCF/Up.thy --- a/src/HOLCF/Up.thy Wed Jun 08 00:59:46 2005 +0200 +++ b/src/HOLCF/Up.thy Wed Jun 08 01:40:39 2005 +0200 @@ -15,114 +15,79 @@ subsection {* Definition of new type for lifting *} -typedef (Up) ('a) "u" = "UNIV :: (unit + 'a) set" .. +typedef (Up) 'a u = "UNIV :: 'a option set" .. consts - Iup :: "'a => ('a)u" - Ifup :: "('a->'b)=>('a)u => 'b::pcpo" + Iup :: "'a \ 'a u" + Ifup :: "('a \ 'b::pcpo) \ 'a u \ 'b" defs - Iup_def: "Iup x == Abs_Up(Inr(x))" - Ifup_def: "Ifup(f)(x)== case Rep_Up(x) of Inl(y) => UU | Inr(z) => f$z" + Iup_def: "Iup x \ Abs_Up (Some x)" + Ifup_def: "Ifup f x \ case Rep_Up x of None \ \ | Some z \ f\z" lemma Abs_Up_inverse2: "Rep_Up (Abs_Up y) = y" by (simp add: Up_def Abs_Up_inverse) -lemma Exh_Up: "z = Abs_Up(Inl ()) | (? x. z = Iup x)" +lemma Exh_Up: "z = Abs_Up None \ (\x. z = Iup x)" apply (unfold Iup_def) apply (rule Rep_Up_inverse [THEN subst]) -apply (rule_tac s = "Rep_Up z" in sumE) -apply (rule disjI1) -apply (rule_tac f = "Abs_Up" in arg_cong) -apply (rule unit_eq [THEN subst]) -apply assumption -apply (rule disjI2) -apply (rule exI) -apply (rule_tac f = "Abs_Up" in arg_cong) -apply assumption +apply (case_tac "Rep_Up z") +apply auto done -lemma inj_Abs_Up: "inj(Abs_Up)" +lemma inj_Abs_Up: "inj Abs_Up" (* worthless *) apply (rule inj_on_inverseI) apply (rule Abs_Up_inverse2) done -lemma inj_Rep_Up: "inj(Rep_Up)" +lemma inj_Rep_Up: "inj Rep_Up" (* worthless *) apply (rule inj_on_inverseI) apply (rule Rep_Up_inverse) done -lemma inject_Iup [dest!]: "Iup x=Iup y ==> x=y" -apply (unfold Iup_def) -apply (rule inj_Inr [THEN injD]) -apply (rule inj_Abs_Up [THEN injD]) -apply assumption -done +lemma Iup_eq [simp]: "(Iup x = Iup y) = (x = y)" +by (simp add: Iup_def Abs_Up_inject Up_def) -lemma defined_Iup: "Iup x~=Abs_Up(Inl ())" -apply (unfold Iup_def) -apply (rule notI) -apply (rule notE) -apply (rule Inl_not_Inr) -apply (rule sym) -apply (erule inj_Abs_Up [THEN injD]) -done +lemma Iup_defined [simp]: "Iup x \ Abs_Up None" +by (simp add: Iup_def Abs_Up_inject Up_def) -lemma upE: "[| p=Abs_Up(Inl ()) ==> Q; !!x. p=Iup(x)==>Q|] ==>Q" -apply (rule Exh_Up [THEN disjE]) -apply fast -apply (erule exE) -apply fast -done +lemma upE: "\p = Abs_Up None \ Q; \x. p = Iup x \ Q\ \ Q" +by (rule Exh_Up [THEN disjE], auto) -lemma Ifup1 [simp]: "Ifup(f)(Abs_Up(Inl ()))=UU" -apply (unfold Ifup_def) -apply (subst Abs_Up_inverse2) -apply (subst sum_case_Inl) -apply (rule refl) -done +lemma Ifup1 [simp]: "Ifup f (Abs_Up None) = \" +by (simp add: Ifup_def Abs_Up_inverse2) -lemma Ifup2 [simp]: "Ifup(f)(Iup(x))=f$x" -apply (unfold Ifup_def Iup_def) -apply (subst Abs_Up_inverse2) -apply (subst sum_case_Inr) -apply (rule refl) -done +lemma Ifup2 [simp]: "Ifup f (Iup x) = f\x" +by (simp add: Ifup_def Iup_def Abs_Up_inverse2) subsection {* Ordering on type @{typ "'a u"} *} instance u :: (sq_ord) sq_ord .. defs (overloaded) - less_up_def: "(op <<) == (%x1 x2. case Rep_Up(x1) of - Inl(y1) => True - | Inr(y2) => (case Rep_Up(x2) of Inl(z1) => False - | Inr(z2) => y2<) \ (\x1 x2. case Rep_Up x1 of + None \ True + | Some y1 \ (case Rep_Up x2 of None \ False + | Some y2 \ y1 \ y2))" -lemma less_up1a [iff]: - "Abs_Up(Inl ())<< z" +lemma minimal_up [iff]: "Abs_Up None \ z" by (simp add: less_up_def Abs_Up_inverse2) -lemma less_up1b [iff]: - "~(Iup x) << (Abs_Up(Inl ()))" +lemma not_Iup_less [iff]: "\ Iup x \ Abs_Up None" by (simp add: Iup_def less_up_def Abs_Up_inverse2) -lemma less_up1c [iff]: - "(Iup x) << (Iup y)=(x< Iup y) = (x \ y)" by (simp add: Iup_def less_up_def Abs_Up_inverse2) subsection {* Type @{typ "'a u"} is a partial order *} -lemma refl_less_up: "(p::'a u) << p" -apply (rule_tac p = "p" in upE) -apply auto -done +lemma refl_less_up: "(p::'a u) \ p" +by (rule_tac p = "p" in upE, auto) -lemma antisym_less_up: "[|(p1::'a u) << p2;p2 << p1|] ==> p1=p2" +lemma antisym_less_up: "\(p1::'a u) \ p2; p2 \ p1\ \ p1 = p2" apply (rule_tac p = "p1" in upE) +apply (rule_tac p = "p2" in upE) apply simp -apply (rule_tac p = "p2" in upE) -apply (erule sym) apply simp apply (rule_tac p = "p2" in upE) apply simp @@ -131,210 +96,104 @@ apply simp done -lemma trans_less_up: "[|(p1::'a u) << p2;p2 << p3|] ==> p1 << p3" +lemma trans_less_up: "\(p1::'a u) \ p2; p2 \ p3\ \ p1 \ p3" apply (rule_tac p = "p1" in upE) apply simp apply (rule_tac p = "p2" in upE) apply simp apply (rule_tac p = "p3" in upE) -apply auto -apply (blast intro: trans_less) +apply simp +apply (auto elim: trans_less) done instance u :: (cpo) po by intro_classes (assumption | rule refl_less_up antisym_less_up trans_less_up)+ -text {* for compatibility with old HOLCF-Version *} -lemma inst_up_po: "(op <<)=(%x1 x2. case Rep_Up(x1) of - Inl(y1) => True - | Inr(y2) => (case Rep_Up(x2) of Inl(z1) => False - | Inr(z2) => y2< Iup(Ifup(LAM x. x)(z)) = z" -by simp - -lemma lub_up1a: "[|chain(Y);EX i x. Y(i)=Iup(x)|] - ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))" +lemma is_lub_Iup: + "range S <<| x \ range (\i. Iup (S i)) <<| Iup x" apply (rule is_lubI) apply (rule ub_rangeI) -apply (rule_tac p = "Y (i) " in upE) -apply (rule_tac s = "Abs_Up (Inl ())" and t = "Y (i) " in subst) -apply (erule sym) -apply (rule less_up1a) -apply (rule_tac t = "Y (i) " in up_lemma1 [THEN subst]) -apply assumption -apply (rule less_up1c [THEN iffD2]) -apply (rule is_ub_thelub) -apply (erule monofun_Ifup2 [THEN ch2ch_monofun]) -apply (rule_tac p = "u" in upE) -apply (erule exE) -apply (erule exE) -apply (rule_tac P = "Y (i) < range(Y) <<| Abs_Up (Inl ())" -apply (rule is_lubI) +apply (subst Iup_less) +apply (erule is_ub_lub) +apply (rule_tac p="u" in upE) +apply (drule ub_rangeD) +apply simp +apply simp +apply (erule is_lub_lub) apply (rule ub_rangeI) -apply (rule_tac p = "Y (i) " in upE) -apply (rule_tac s = "Abs_Up (Inl ())" and t = "Y (i) " in ssubst) -apply assumption -apply (rule refl_less) +apply (drule_tac i=i in ub_rangeD) apply simp -apply (rule less_up1a) -done - -lemmas thelub_up1a = lub_up1a [THEN thelubI, standard] -(* -[| chain ?Y1; EX i x. ?Y1 i = Iup x |] ==> - lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i)))) -*) - -lemmas thelub_up1b = lub_up1b [THEN thelubI, standard] -(* -[| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==> - lub (range ?Y1) = UU_up -*) - -text {* New versions where @{typ "'a"} does not have to be a pcpo *} - -lemma up_lemma1a: "EX x. z=Iup(x) ==> Iup(THE a. Iup a = z) = z" -apply (erule exE) -apply (rule theI) -apply (erule sym) -apply simp -apply (erule inject_Iup) done text {* Now some lemmas about chains of @{typ "'a u"} elements *} -lemma up_chain_lemma1: - "[| chain Y; EX x. Y j = Iup x |] ==> EX x. Y (i + j) = Iup x" +lemma up_lemma1: "z \ Abs_Up None \ Iup (THE a. Iup a = z) = z" +by (rule_tac p="z" in upE, simp_all) + +lemma up_lemma2: + "\chain Y; Y j \ Abs_Up None\ \ Y (i + j) \ Abs_Up None" +apply (erule contrapos_nn) apply (drule_tac x="j" and y="i + j" in chain_mono3) apply (rule le_add2) -apply (rule_tac p="Y (i + j)" in upE) -apply auto +apply (rule_tac p="Y j" in upE) +apply assumption +apply simp done -lemma up_chain_lemma2: - "[| chain Y; EX x. Y j = Iup x |] ==> - Iup (THE a. Iup a = Y (i + j)) = Y (i + j)" -apply (drule_tac i=i in up_chain_lemma1) -apply assumption -apply (erule up_lemma1a) -done +lemma up_lemma3: + "\chain Y; Y j \ Abs_Up None\ \ Iup (THE a. Iup a = Y (i + j)) = Y (i + j)" +by (rule up_lemma1 [OF up_lemma2]) -lemma up_chain_lemma3: - "[| chain Y; EX x. Y j = Iup x |] ==> chain (%i. THE a. Iup a = Y (i + j))" +lemma up_lemma4: + "\chain Y; Y j \ Abs_Up None\ \ chain (\i. THE a. Iup a = Y (i + j))" apply (rule chainI) -apply (rule less_up1c [THEN iffD1]) -apply (simp only: up_chain_lemma2) +apply (rule Iup_less [THEN iffD1]) +apply (subst up_lemma3, assumption+)+ apply (simp add: chainE) done -lemma up_chain_lemma4: - "[| chain Y; EX x. Y j = Iup x |] ==> - (%i. Y (i + j)) = (%i. Iup (THE a. Iup a = Y (i + j)))" -apply (rule ext) -apply (rule up_chain_lemma2 [symmetric]) -apply assumption+ -done +lemma up_lemma5: + "\chain Y; Y j \ Abs_Up None\ \ + (\i. Y (i + j)) = (\i. Iup (THE a. Iup a = Y (i + j)))" +by (rule ext, rule up_lemma3 [symmetric]) -lemma is_lub_range_shift: - "[| chain S; range (%i. S (i + j)) <<| x |] ==> range S <<| x" -apply (rule is_lubI) -apply (rule ub_rangeI) -apply (rule trans_less) -apply (erule chain_mono3) -apply (rule le_add1) -apply (erule is_ub_lub) -apply (erule is_lub_lub) -apply (rule ub_rangeI) -apply (erule ub_rangeD) +lemma up_lemma6: + "\chain Y; Y j \ Abs_Up None\ + \ range Y <<| Iup (\i. THE a. Iup a = Y(i + j))" +apply (rule_tac j1="j" in is_lub_range_shift [THEN iffD1]) +apply assumption +apply (subst up_lemma5, assumption+) +apply (rule is_lub_Iup) +apply (rule thelubE [OF _ refl]) +apply (rule up_lemma4, assumption+) done -lemma is_lub_Iup: - "range S <<| x \ range (%i. Iup (S i)) <<| Iup x" -apply (rule is_lubI) -apply (rule ub_rangeI) -apply (subst less_up1c) -apply (erule is_ub_lub) -apply (rule_tac p=u in upE) -apply (drule ub_rangeD) -apply (simp only: less_up1b) -apply (simp only: less_up1c) -apply (erule is_lub_lub) -apply (rule ub_rangeI) -apply (drule_tac i=i in ub_rangeD) -apply (simp only: less_up1c) +lemma up_chain_cases: + "chain Y \ + (\A. chain A \ lub (range Y) = Iup (lub (range A)) \ + (\j. \i. Y (i + j) = Iup (A i))) \ (Y = (\i. Abs_Up None))" +apply (rule disjCI) +apply (simp add: expand_fun_eq) +apply (erule exE, rename_tac j) +apply (rule_tac x="\i. THE a. Iup a = Y (i + j)" in exI) +apply (rule conjI) +apply (simp add: up_lemma4) +apply (rule conjI) +apply (simp add: up_lemma6 [THEN thelubI]) +apply (rule_tac x=j in exI) +apply (simp add: up_lemma3) done -lemma lub_up1c: "[|chain(Y); EX x. Y(j)=Iup(x)|] - ==> range(Y) <<| Iup(lub(range(%i. THE a. Iup a = Y(i + j))))" -apply (rule_tac j=j in is_lub_range_shift) -apply assumption -apply (subst up_chain_lemma4) -apply assumption+ -apply (rule is_lub_Iup) -apply (rule thelubE [OF _ refl]) -apply (rule up_chain_lemma3) -apply assumption+ -done - -lemmas thelub_up1c = lub_up1c [THEN thelubI, standard] - -lemma cpo_up: "chain(Y::nat=>('a)u) ==> EX x. range(Y) <<|x" -apply (case_tac "EX i x. Y i = Iup x") -apply (erule exE) -apply (rule exI) -apply (erule lub_up1c) -apply assumption -apply (rule exI) -apply (erule lub_up1b) -apply simp +lemma cpo_up: "chain (Y::nat \ 'a u) \ \x. range Y <<| x" +apply (frule up_chain_cases, safe) +apply (rule_tac x="Iup (lub (range A))" in exI) +apply (erule_tac j1="j" in is_lub_range_shift [THEN iffD1]) +apply (simp add: is_lub_Iup thelubE) +apply (rule_tac x="Abs_Up None" in exI) +apply (rule lub_const) done instance u :: (cpo) cpo @@ -342,13 +201,8 @@ subsection {* Type @{typ "'a u"} is pointed *} -lemma minimal_up: "Abs_Up(Inl ()) << z" -by (rule less_up1a) - -lemmas UU_up_def = minimal_up [THEN minimal2UU, symmetric, standard] - -lemma least_up: "EX x::'a u. ALL y. x<y" +apply (rule_tac x = "Abs_Up None" in exI) apply (rule minimal_up [THEN allI]) done @@ -356,244 +210,106 @@ by intro_classes (rule least_up) text {* for compatibility with old HOLCF-Version *} -lemma inst_up_pcpo: "UU = Abs_Up(Inl ())" -by (simp add: UU_def UU_up_def) +lemma inst_up_pcpo: "\ = Abs_Up None" +by (rule minimal_up [THEN UU_I, symmetric]) text {* some lemmas restated for class pcpo *} -lemma less_up3b: "~ Iup(x) << UU" +lemma less_up3b: "~ Iup(x) \ \" apply (subst inst_up_pcpo) -apply (rule less_up1b) +apply simp done -lemma defined_Iup2 [iff]: "Iup(x) ~= UU" +lemma defined_Iup2 [iff]: "Iup(x) ~= \" apply (subst inst_up_pcpo) -apply (rule defined_Iup) +apply (rule Iup_defined) done subsection {* Continuity of @{term Iup} and @{term Ifup} *} text {* continuity for @{term Iup} *} -lemma cont_Iup [iff]: "cont(Iup)" +lemma cont_Iup: "cont Iup" apply (rule contI) apply (rule is_lub_Iup) apply (erule thelubE [OF _ refl]) done -lemmas contlub_Iup = cont_Iup [THEN cont2contlub] - text {* continuity for @{term Ifup} *} -lemma contlub_Ifup1: "contlub(Ifup)" -apply (rule contlubI) -apply (rule trans) -apply (rule_tac [2] thelub_fun [symmetric]) -apply (erule_tac [2] monofun_Ifup1 [THEN ch2ch_monofun]) -apply (rule ext) -apply (rule_tac p = "x" in upE) -apply simp -apply (rule lub_const [THEN thelubI, symmetric]) -apply simp -apply (erule contlub_cfun_fun) +lemma cont_Ifup1: "cont (\f. Ifup f x)" +apply (rule contI) +apply (rule_tac p="x" in upE) +apply (simp add: lub_const) +apply (simp add: cont_cfun_fun) done -lemma contlub_Ifup2: "contlub(Ifup(f))" -apply (rule contlubI) -apply (case_tac "EX i x. Y i = Iup x") -apply (erule exE) -apply (subst thelub_up1c) -apply assumption -apply assumption -apply simp -prefer 2 -apply (subst thelub_up1b) -apply assumption -apply simp -apply simp -apply (rule chain_UU_I_inverse [symmetric]) -apply (rule allI) -apply (rule_tac p = "Y(i)" in upE) -apply simp +lemma monofun_Ifup2: "monofun (\x. Ifup f x)" +apply (rule monofunI) +apply (rule_tac p="x" in upE) apply simp -apply (subst contlub_cfun_arg) -apply (erule up_chain_lemma3) -apply assumption -apply (rule trans) -prefer 2 -apply (rule_tac j=i in lub_range_shift) -apply (erule monofun_Ifup2 [THEN ch2ch_monofun]) -apply (rule lub_equal [rule_format]) -apply (rule chain_monofun) -apply (erule up_chain_lemma3) -apply assumption -apply (rule monofun_Ifup2 [THEN ch2ch_monofun]) -apply (erule chain_shift) -apply (drule_tac i=k in up_chain_lemma1) -apply assumption -apply clarify +apply (rule_tac p="y" in upE) apply simp -apply (subst the_equality) -apply (rule refl) -apply (erule inject_Iup) -apply (rule refl) +apply (simp add: monofun_cfun_arg) done -lemma cont_Ifup1: "cont(Ifup)" -apply (rule monocontlub2cont) -apply (rule monofun_Ifup1) -apply (rule contlub_Ifup1) -done - -lemma cont_Ifup2: "cont(Ifup(f))" -apply (rule monocontlub2cont) -apply (rule monofun_Ifup2) -apply (rule contlub_Ifup2) +lemma cont_Ifup2: "cont (\x. Ifup f x)" +apply (rule contI) +apply (frule up_chain_cases, safe) +apply (rule_tac j1="j" in is_lub_range_shift [THEN iffD1]) +apply (erule monofun_Ifup2 [THEN ch2ch_monofun]) +apply (simp add: cont_cfun_arg) +apply (simp add: thelub_const lub_const) done subsection {* Continuous versions of constants *} constdefs - up :: "'a -> ('a)u" - "up == (LAM x. Iup(x))" - fup :: "('a->'c)-> ('a)u -> 'c::pcpo" - "fup == (LAM f p. Ifup(f)(p))" + up :: "'a \ 'a u" + "up \ \ x. Iup x" + + fup :: "('a \ 'b::pcpo) \ 'a u \ 'b" + "fup \ \ f p. Ifup f p" translations -"case l of up$x => t1" == "fup$(LAM x. t1)$l" +"case l of up\x => t1" == "fup\(LAM x. t1)\l" text {* continuous versions of lemmas for @{typ "('a)u"} *} -lemma Exh_Up1: "z = UU | (EX x. z = up$x)" -apply (unfold up_def) -apply simp -apply (subst inst_up_pcpo) -apply (rule Exh_Up) -done - -lemma inject_up: "up$x=up$y ==> x=y" -apply (unfold up_def) -apply (rule inject_Iup) -apply auto -done - -lemma defined_up [simp]: " up$x ~= UU" -by (simp add: up_def) - -lemma upE1: - "[| p=UU ==> Q; !!x. p=up$x==>Q|] ==>Q" -apply (unfold up_def) -apply (rule upE) -apply (simp only: inst_up_pcpo) -apply fast -apply simp -done - -lemmas up_conts = cont_lemmas1 cont_Iup cont_Ifup1 cont_Ifup2 cont2cont_CF1L - -lemma fup1 [simp]: "fup$f$UU=UU" -apply (unfold up_def fup_def) -apply (subst inst_up_pcpo) -apply (subst beta_cfun) -apply (intro up_conts) -apply (subst beta_cfun) -apply (rule cont_Ifup2) -apply simp -done - -lemma fup2 [simp]: "fup$f$(up$x)=f$x" -apply (unfold up_def fup_def) -apply (simplesubst beta_cfun) -apply (rule cont_Iup) -apply (subst beta_cfun) -apply (intro up_conts) -apply (subst beta_cfun) -apply (rule cont_Ifup2) -apply simp +lemma Exh_Up1: "z = \ \ (\x. z = up\x)" +apply (rule_tac p="z" in upE) +apply (simp add: inst_up_pcpo) +apply (simp add: up_def cont_Iup) done -lemma less_up4b: "~ up$x << UU" -by (simp add: up_def fup_def less_up3b) +lemma up_inject: "up\x = up\y \ x = y" +by (simp add: up_def cont_Iup) -lemma less_up4c: "(up$x << up$y) = (x<x = up\y) = (x = y)" +by (rule iffI, erule up_inject, simp) + +lemma up_defined [simp]: " up\x \ \" +by (simp add: up_def cont_Iup inst_up_pcpo) -lemma thelub_up2a: -"[| chain(Y); EX i x. Y(i) = up$x |] ==> - lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))" -apply (unfold up_def fup_def) -apply (subst beta_cfun) -apply (rule cont_Iup) -apply (subst beta_cfun) -apply (intro up_conts) -apply (subst beta_cfun [THEN ext]) -apply (rule cont_Ifup2) -apply (rule thelub_up1a) -apply assumption -apply (erule exE) -apply (erule exE) -apply (rule exI) -apply (rule exI) -apply (erule box_equals) -apply (rule refl) -apply simp -done +lemma not_up_less_UU [simp]: "\ up\x \ \" +by (simp add: eq_UU_iff [symmetric]) -lemma thelub_up2b: -"[| chain(Y); ! i x. Y(i) ~= up$x |] ==> lub(range(Y)) = UU" -apply (unfold up_def fup_def) -apply (subst inst_up_pcpo) -apply (erule thelub_up1b) -apply simp +lemma up_less: "(up\x \ up\y) = (x \ y)" +by (simp add: up_def cont_Iup) + +lemma upE1: "\p = \ \ Q; \x. p = up\x \ Q\ \ Q" +apply (rule_tac p="p" in upE) +apply (simp add: inst_up_pcpo) +apply (simp add: up_def cont_Iup) done -lemma up_lemma2: "(EX x. z = up$x) = (z~=UU)" -apply (rule iffI) -apply (erule exE) -apply simp -apply (rule_tac p = "z" in upE1) -apply simp -apply (erule exI) -done - -lemma thelub_up2a_rev: - "[| chain(Y); lub(range(Y)) = up$x |] ==> EX i x. Y(i) = up$x" -apply (rule exE) -apply (rule chain_UU_I_inverse2) -apply (rule up_lemma2 [THEN iffD1]) -apply (erule exI) -apply (rule exI) -apply (rule up_lemma2 [THEN iffD2]) -apply assumption -done - -lemma thelub_up2b_rev: - "[| chain(Y); lub(range(Y)) = UU |] ==> ! i x. Y(i) ~= up$x" -by (blast dest!: chain_UU_I [THEN spec] exI [THEN up_lemma2 [THEN iffD1]]) +lemma fup1 [simp]: "fup\f\\ = \" +by (simp add: fup_def cont_Ifup1 cont_Ifup2 inst_up_pcpo) -lemma thelub_up3: "chain(Y) ==> lub(range(Y)) = UU | - lub(range(Y)) = up$(lub(range(%i. fup$(LAM x. x)$(Y i))))" -apply (rule disjE) -apply (rule_tac [2] disjI1) -apply (rule_tac [2] thelub_up2b) -prefer 2 apply (assumption) -prefer 2 apply (assumption) -apply (rule_tac [2] disjI2) -apply (rule_tac [2] thelub_up2a) -prefer 2 apply (assumption) -prefer 2 apply (assumption) -apply fast -done +lemma fup2 [simp]: "fup\f\(up\x) = f\x" +by (simp add: up_def fup_def cont_Iup cont_Ifup1 cont_Ifup2 ) -lemma fup3: "fup$up$x=x" -apply (rule_tac p = "x" in upE1) -apply simp -apply simp -done - -text {* for backward compatibility *} - -lemmas less_up2b = less_up1b -lemmas less_up2c = less_up1c +lemma fup3: "fup\up\x = x" +by (rule_tac p=x in upE1, simp_all) end