equal
deleted
inserted
replaced
98 |
98 |
99 |
99 |
100 subsection {* Continuous function space is pointed *} |
100 subsection {* Continuous function space is pointed *} |
101 |
101 |
102 lemma UU_CFun: "\<bottom> \<in> CFun" |
102 lemma UU_CFun: "\<bottom> \<in> CFun" |
103 by (simp add: CFun_def inst_fun_pcpo cont_const) |
103 by (simp add: CFun_def inst_fun_pcpo) |
104 |
104 |
105 instance cfun :: (finite_po, finite_po) finite_po |
105 instance cfun :: (finite_po, finite_po) finite_po |
106 by (rule typedef_finite_po [OF type_definition_CFun]) |
106 by (rule typedef_finite_po [OF type_definition_CFun]) |
107 |
107 |
108 instance cfun :: (finite_po, chfin) chfin |
108 instance cfun :: (finite_po, chfin) chfin |
299 |
299 |
300 subsection {* Continuity simplification procedure *} |
300 subsection {* Continuity simplification procedure *} |
301 |
301 |
302 text {* cont2cont lemma for @{term Rep_CFun} *} |
302 text {* cont2cont lemma for @{term Rep_CFun} *} |
303 |
303 |
304 lemma cont2cont_Rep_CFun [cont2cont]: |
304 lemma cont2cont_Rep_CFun [simp, cont2cont]: |
305 assumes f: "cont (\<lambda>x. f x)" |
305 assumes f: "cont (\<lambda>x. f x)" |
306 assumes t: "cont (\<lambda>x. t x)" |
306 assumes t: "cont (\<lambda>x. t x)" |
307 shows "cont (\<lambda>x. (f x)\<cdot>(t x))" |
307 shows "cont (\<lambda>x. (f x)\<cdot>(t x))" |
308 proof - |
308 proof - |
309 have "cont (\<lambda>x. Rep_CFun (f x))" |
309 have "cont (\<lambda>x. Rep_CFun (f x))" |
339 text {* |
339 text {* |
340 This version does work as a cont2cont rule, since it |
340 This version does work as a cont2cont rule, since it |
341 has only a single subgoal. |
341 has only a single subgoal. |
342 *} |
342 *} |
343 |
343 |
344 lemma cont2cont_LAM' [cont2cont]: |
344 lemma cont2cont_LAM' [simp, cont2cont]: |
345 fixes f :: "'a::cpo \<Rightarrow> 'b::cpo \<Rightarrow> 'c::cpo" |
345 fixes f :: "'a::cpo \<Rightarrow> 'b::cpo \<Rightarrow> 'c::cpo" |
346 assumes f: "cont (\<lambda>p. f (fst p) (snd p))" |
346 assumes f: "cont (\<lambda>p. f (fst p) (snd p))" |
347 shows "cont (\<lambda>x. \<Lambda> y. f x y)" |
347 shows "cont (\<lambda>x. \<Lambda> y. f x y)" |
348 proof (rule cont2cont_LAM) |
348 proof (rule cont2cont_LAM) |
349 fix x :: 'a show "cont (\<lambda>y. f x y)" |
349 fix x :: 'a show "cont (\<lambda>y. f x y)" |
351 next |
351 next |
352 fix y :: 'b show "cont (\<lambda>x. f x y)" |
352 fix y :: 'b show "cont (\<lambda>x. f x y)" |
353 using f by (rule cont_fst_snd_D1) |
353 using f by (rule cont_fst_snd_D1) |
354 qed |
354 qed |
355 |
355 |
356 lemma cont2cont_LAM_discrete [cont2cont]: |
356 lemma cont2cont_LAM_discrete [simp, cont2cont]: |
357 "(\<And>y::'a::discrete_cpo. cont (\<lambda>x. f x y)) \<Longrightarrow> cont (\<lambda>x. \<Lambda> y. f x y)" |
357 "(\<And>y::'a::discrete_cpo. cont (\<lambda>x. f x y)) \<Longrightarrow> cont (\<lambda>x. \<Lambda> y. f x y)" |
358 by (simp add: cont2cont_LAM) |
358 by (simp add: cont2cont_LAM) |
359 |
359 |
360 lemmas cont_lemmas1 = |
360 lemmas cont_lemmas1 = |
361 cont_const cont_id cont_Rep_CFun2 cont2cont_Rep_CFun cont2cont_LAM |
361 cont_const cont_id cont_Rep_CFun2 cont2cont_Rep_CFun cont2cont_LAM |
554 assumes g1: "\<And>y. cont (\<lambda>x. g x y)" |
554 assumes g1: "\<And>y. cont (\<lambda>x. g x y)" |
555 assumes g2: "\<And>x. cont (\<lambda>y. g x y)" |
555 assumes g2: "\<And>x. cont (\<lambda>y. g x y)" |
556 shows "cont (\<lambda>x. let y = f x in g x y)" |
556 shows "cont (\<lambda>x. let y = f x in g x y)" |
557 unfolding Let_def using f g2 g1 by (rule cont_apply) |
557 unfolding Let_def using f g2 g1 by (rule cont_apply) |
558 |
558 |
559 lemma cont2cont_Let' [cont2cont]: |
559 lemma cont2cont_Let' [simp, cont2cont]: |
560 assumes f: "cont (\<lambda>x. f x)" |
560 assumes f: "cont (\<lambda>x. f x)" |
561 assumes g: "cont (\<lambda>p. g (fst p) (snd p))" |
561 assumes g: "cont (\<lambda>p. g (fst p) (snd p))" |
562 shows "cont (\<lambda>x. let y = f x in g x y)" |
562 shows "cont (\<lambda>x. let y = f x in g x y)" |
563 using f |
563 using f |
564 proof (rule cont2cont_Let) |
564 proof (rule cont2cont_Let) |