equal
deleted
inserted
replaced
94 assumes "approx_chain a" and "approx_chain b" |
94 assumes "approx_chain a" and "approx_chain b" |
95 shows "approx_chain (\<lambda>i. cfun_map\<cdot>(a i)\<cdot>(b i))" |
95 shows "approx_chain (\<lambda>i. cfun_map\<cdot>(a i)\<cdot>(b i))" |
96 using assms unfolding approx_chain_def |
96 using assms unfolding approx_chain_def |
97 by (simp add: lub_APP cfun_map_ID finite_deflation_cfun_map) |
97 by (simp add: lub_APP cfun_map_ID finite_deflation_cfun_map) |
98 |
98 |
99 lemma approx_chain_cprod_map: |
99 lemma approx_chain_prod_map: |
100 assumes "approx_chain a" and "approx_chain b" |
100 assumes "approx_chain a" and "approx_chain b" |
101 shows "approx_chain (\<lambda>i. cprod_map\<cdot>(a i)\<cdot>(b i))" |
101 shows "approx_chain (\<lambda>i. prod_map\<cdot>(a i)\<cdot>(b i))" |
102 using assms unfolding approx_chain_def |
102 using assms unfolding approx_chain_def |
103 by (simp add: lub_APP cprod_map_ID finite_deflation_cprod_map) |
103 by (simp add: lub_APP prod_map_ID finite_deflation_prod_map) |
104 |
104 |
105 text {* Approx chains for countable discrete types. *} |
105 text {* Approx chains for countable discrete types. *} |
106 |
106 |
107 definition discr_approx :: "nat \<Rightarrow> 'a::countable discr u \<rightarrow> 'a discr u" |
107 definition discr_approx :: "nat \<Rightarrow> 'a::countable discr u \<rightarrow> 'a discr u" |
108 where "discr_approx = (\<lambda>i. \<Lambda>(up\<cdot>x). if to_nat (undiscr x) < i then up\<cdot>x else \<bottom>)" |
108 where "discr_approx = (\<lambda>i. \<Lambda>(up\<cdot>x). if to_nat (undiscr x) < i then up\<cdot>x else \<bottom>)" |
226 |
226 |
227 instance prod :: (bifinite, bifinite) bifinite |
227 instance prod :: (bifinite, bifinite) bifinite |
228 proof |
228 proof |
229 show "\<exists>(a::nat \<Rightarrow> ('a \<times> 'b) \<rightarrow> ('a \<times> 'b)). approx_chain a" |
229 show "\<exists>(a::nat \<Rightarrow> ('a \<times> 'b) \<rightarrow> ('a \<times> 'b)). approx_chain a" |
230 using bifinite [where 'a='a] and bifinite [where 'a='b] |
230 using bifinite [where 'a='a] and bifinite [where 'a='b] |
231 by (fast intro!: approx_chain_cprod_map) |
231 by (fast intro!: approx_chain_prod_map) |
232 qed |
232 qed |
233 |
233 |
234 instance sfun :: (bifinite, bifinite) bifinite |
234 instance sfun :: (bifinite, bifinite) bifinite |
235 proof |
235 proof |
236 show "\<exists>(a::nat \<Rightarrow> ('a \<rightarrow>! 'b) \<rightarrow> ('a \<rightarrow>! 'b)). approx_chain a" |
236 show "\<exists>(a::nat \<Rightarrow> ('a \<rightarrow>! 'b) \<rightarrow> ('a \<rightarrow>! 'b)). approx_chain a" |