src/HOLCF/Bifinite.thy
 changeset 25909 6b96b9392873 parent 25903 5e59af604d4f child 25922 cb04d05e95fb
```     1.1 --- a/src/HOLCF/Bifinite.thy	Mon Jan 14 20:45:10 2008 +0100
1.2 +++ b/src/HOLCF/Bifinite.thy	Mon Jan 14 21:15:20 2008 +0100
1.3 @@ -11,16 +11,18 @@
1.4
1.5  subsection {* Bifinite domains *}
1.6
1.7 -axclass approx < pcpo
1.8 +axclass approx < cpo
1.9
1.10  consts approx :: "nat \<Rightarrow> 'a::approx \<rightarrow> 'a"
1.11
1.12 -axclass bifinite < approx
1.13 +axclass bifinite_cpo < approx
1.14    chain_approx_app: "chain (\<lambda>i. approx i\<cdot>x)"
1.15    lub_approx_app [simp]: "(\<Squnion>i. approx i\<cdot>x) = x"
1.16    approx_idem: "approx i\<cdot>(approx i\<cdot>x) = approx i\<cdot>x"
1.17    finite_fixes_approx: "finite {x. approx i\<cdot>x = x}"
1.18
1.19 +axclass bifinite < bifinite_cpo, pcpo
1.20 +
1.21  lemma finite_range_imp_finite_fixes:
1.22    "finite {x. \<exists>y. x = f y} \<Longrightarrow> finite {x. f x = x}"
1.23  apply (subgoal_tac "{x. f x = x} \<subseteq> {x. \<exists>y. x = f y}")
1.24 @@ -29,17 +31,17 @@
1.25  done
1.26
1.27  lemma chain_approx [simp]:
1.28 -  "chain (approx :: nat \<Rightarrow> 'a::bifinite \<rightarrow> 'a)"
1.29 +  "chain (approx :: nat \<Rightarrow> 'a::bifinite_cpo \<rightarrow> 'a)"
1.30  apply (rule chainI)
1.31  apply (rule less_cfun_ext)
1.32  apply (rule chainE)
1.33  apply (rule chain_approx_app)
1.34  done
1.35
1.36 -lemma lub_approx [simp]: "(\<Squnion>i. approx i) = (\<Lambda>(x::'a::bifinite). x)"
1.37 +lemma lub_approx [simp]: "(\<Squnion>i. approx i) = (\<Lambda>(x::'a::bifinite_cpo). x)"
1.38  by (rule ext_cfun, simp add: contlub_cfun_fun)
1.39
1.40 -lemma approx_less: "approx i\<cdot>x \<sqsubseteq> (x::'a::bifinite)"
1.41 +lemma approx_less: "approx i\<cdot>x \<sqsubseteq> (x::'a::bifinite_cpo)"
1.42  apply (subgoal_tac "approx i\<cdot>x \<sqsubseteq> (\<Squnion>i. approx i\<cdot>x)", simp)
1.43  apply (rule is_ub_thelub, simp)
1.44  done
1.45 @@ -48,7 +50,7 @@
1.46  by (rule UU_I, rule approx_less)
1.47
1.48  lemma approx_approx1:
1.49 -  "i \<le> j \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx i\<cdot>(x::'a::bifinite)"
1.50 +  "i \<le> j \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx i\<cdot>(x::'a::bifinite_cpo)"
1.51  apply (rule antisym_less)
1.52  apply (rule monofun_cfun_arg [OF approx_less])
1.53  apply (rule sq_ord_eq_less_trans [OF approx_idem [symmetric]])
1.54 @@ -58,7 +60,7 @@
1.55  done
1.56
1.57  lemma approx_approx2:
1.58 -  "j \<le> i \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx j\<cdot>(x::'a::bifinite)"
1.59 +  "j \<le> i \<Longrightarrow> approx i\<cdot>(approx j\<cdot>x) = approx j\<cdot>(x::'a::bifinite_cpo)"
1.60  apply (rule antisym_less)
1.61  apply (rule approx_less)
1.62  apply (rule sq_ord_eq_less_trans [OF approx_idem [symmetric]])
1.63 @@ -67,7 +69,7 @@
1.64  done
1.65
1.66  lemma approx_approx [simp]:
1.67 -  "approx i\<cdot>(approx j\<cdot>x) = approx (min i j)\<cdot>(x::'a::bifinite)"
1.68 +  "approx i\<cdot>(approx j\<cdot>x) = approx (min i j)\<cdot>(x::'a::bifinite_cpo)"
1.69  apply (rule_tac x=i and y=j in linorder_le_cases)
1.70  apply (simp add: approx_approx1 min_def)
1.71  apply (simp add: approx_approx2 min_def)
1.72 @@ -77,15 +79,15 @@
1.73    "\<forall>x. f (f x) = f x \<Longrightarrow> {x. f x = x} = {y. \<exists>x. y = f x}"
1.74  by (auto simp add: eq_sym_conv)
1.75
1.76 -lemma finite_approx: "finite {y::'a::bifinite. \<exists>x. y = approx n\<cdot>x}"
1.77 +lemma finite_approx: "finite {y::'a::bifinite_cpo. \<exists>x. y = approx n\<cdot>x}"
1.78  using finite_fixes_approx by (simp add: idem_fixes_eq_range)
1.79
1.80  lemma finite_range_approx:
1.81 -  "finite (range (\<lambda>x::'a::bifinite. approx n\<cdot>x))"
1.82 +  "finite (range (\<lambda>x::'a::bifinite_cpo. approx n\<cdot>x))"
1.83  by (simp add: image_def finite_approx)
1.84
1.85  lemma compact_approx [simp]:
1.86 -  fixes x :: "'a::bifinite"
1.87 +  fixes x :: "'a::bifinite_cpo"
1.88    shows "compact (approx n\<cdot>x)"
1.89  proof (rule compactI2)
1.90    fix Y::"nat \<Rightarrow> 'a"
1.91 @@ -116,7 +118,7 @@
1.92  qed
1.93
1.94  lemma bifinite_compact_eq_approx:
1.95 -  fixes x :: "'a::bifinite"
1.96 +  fixes x :: "'a::bifinite_cpo"
1.97    assumes x: "compact x"
1.98    shows "\<exists>i. approx i\<cdot>x = x"
1.99  proof -
1.100 @@ -130,7 +132,7 @@
1.101  qed
1.102
1.103  lemma bifinite_compact_iff:
1.104 -  "compact (x::'a::bifinite) = (\<exists>n. approx n\<cdot>x = x)"
1.105 +  "compact (x::'a::bifinite_cpo) = (\<exists>n. approx n\<cdot>x = x)"
1.106   apply (rule iffI)
1.107    apply (erule bifinite_compact_eq_approx)
1.108   apply (erule exE)
1.109 @@ -148,7 +150,7 @@
1.110  qed
1.111
1.112  lemma bifinite_less_ext:
1.113 -  fixes x y :: "'a::bifinite"
1.114 +  fixes x y :: "'a::bifinite_cpo"
1.115    shows "(\<And>i. approx i\<cdot>x \<sqsubseteq> approx i\<cdot>y) \<Longrightarrow> x \<sqsubseteq> y"
1.116  apply (subgoal_tac "(\<Squnion>i. approx i\<cdot>x) \<sqsubseteq> (\<Squnion>i. approx i\<cdot>y)", simp)
1.117  apply (rule lub_mono [rule_format], simp, simp, simp)
1.118 @@ -176,13 +178,13 @@
1.119   apply clarsimp
1.120  done
1.121
1.122 -instance "->" :: (bifinite, bifinite) approx ..
1.123 +instance "->" :: (bifinite_cpo, bifinite_cpo) approx ..
1.124
1.126    approx_cfun_def:
1.127      "approx \<equiv> \<lambda>n. \<Lambda> f x. approx n\<cdot>(f\<cdot>(approx n\<cdot>x))"
1.128
1.129 -instance "->" :: (bifinite, bifinite) bifinite
1.130 +instance "->" :: (bifinite_cpo, bifinite_cpo) bifinite_cpo
1.131   apply (intro_classes, unfold approx_cfun_def)
1.132      apply simp
1.133     apply (simp add: lub_distribs eta_cfun)
1.134 @@ -192,6 +194,8 @@
1.135   apply (intro finite_range_lemma finite_approx)
1.136  done
1.137
1.138 +instance "->" :: (bifinite_cpo, bifinite) bifinite ..
1.139 +
1.140  lemma approx_cfun: "approx n\<cdot>f\<cdot>x = approx n\<cdot>(f\<cdot>(approx n\<cdot>x))"