src/HOL/HOLCF/Lift.thy
changeset 69597 ff784d5a5bfb
parent 62175 8ffc4d0e652d
child 72835 66ca5016b008
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
    30 done
    30 done
    31 
    31 
    32 old_rep_datatype "\<bottom>::'a lift" Def
    32 old_rep_datatype "\<bottom>::'a lift" Def
    33   by (erule lift_induct) (simp_all add: Def_def Abs_lift_inject inst_lift_pcpo)
    33   by (erule lift_induct) (simp_all add: Def_def Abs_lift_inject inst_lift_pcpo)
    34 
    34 
    35 text \<open>@{term bottom} and @{term Def}\<close>
    35 text \<open>\<^term>\<open>bottom\<close> and \<^term>\<open>Def\<close>\<close>
    36 
    36 
    37 lemma not_Undef_is_Def: "(x \<noteq> \<bottom>) = (\<exists>y. x = Def y)"
    37 lemma not_Undef_is_Def: "(x \<noteq> \<bottom>) = (\<exists>y. x = Def y)"
    38   by (cases x) simp_all
    38   by (cases x) simp_all
    39 
    39 
    40 lemma lift_definedE: "\<lbrakk>x \<noteq> \<bottom>; \<And>a. x = Def a \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R"
    40 lemma lift_definedE: "\<lbrakk>x \<noteq> \<bottom>; \<And>a. x = Def a \<Longrightarrow> R\<rbrakk> \<Longrightarrow> R"
    41   by (cases x) simp_all
    41   by (cases x) simp_all
    42 
    42 
    43 text \<open>
    43 text \<open>
    44   For @{term "x ~= \<bottom>"} in assumptions \<open>defined\<close> replaces \<open>x\<close> by \<open>Def a\<close> in conclusion.\<close>
    44   For \<^term>\<open>x ~= \<bottom>\<close> in assumptions \<open>defined\<close> replaces \<open>x\<close> by \<open>Def a\<close> in conclusion.\<close>
    45 
    45 
    46 method_setup defined = \<open>
    46 method_setup defined = \<open>
    47   Scan.succeed (fn ctxt => SIMPLE_METHOD'
    47   Scan.succeed (fn ctxt => SIMPLE_METHOD'
    48     (eresolve_tac ctxt @{thms lift_definedE} THEN' asm_simp_tac ctxt))
    48     (eresolve_tac ctxt @{thms lift_definedE} THEN' asm_simp_tac ctxt))
    49 \<close>
    49 \<close>
    68   fix x y :: "'a lift"
    68   fix x y :: "'a lift"
    69   assume "x \<sqsubseteq> y" thus "x = \<bottom> \<or> x = y"
    69   assume "x \<sqsubseteq> y" thus "x = \<bottom> \<or> x = y"
    70     by (induct x) auto
    70     by (induct x) auto
    71 qed
    71 qed
    72 
    72 
    73 subsection \<open>Continuity of @{const case_lift}\<close>
    73 subsection \<open>Continuity of \<^const>\<open>case_lift\<close>\<close>
    74 
    74 
    75 lemma case_lift_eq: "case_lift \<bottom> f x = fup\<cdot>(\<Lambda> y. f (undiscr y))\<cdot>(Rep_lift x)"
    75 lemma case_lift_eq: "case_lift \<bottom> f x = fup\<cdot>(\<Lambda> y. f (undiscr y))\<cdot>(Rep_lift x)"
    76 apply (induct x, unfold lift.case)
    76 apply (induct x, unfold lift.case)
    77 apply (simp add: Rep_lift_strict)
    77 apply (simp add: Rep_lift_strict)
    78 apply (simp add: Def_def Abs_lift_inverse)
    78 apply (simp add: Def_def Abs_lift_inverse)