| author | wenzelm | 
| Sun, 04 Jan 2009 15:28:40 +0100 | |
| changeset 29345 | 5904873d8f11 | 
| parent 29138 | 661a8db7e647 | 
| child 29530 | 9905b660612b | 
| permissions | -rw-r--r-- | 
| 15600 | 1 | (* Title: HOLCF/Cfun.thy | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 2 | Author: Franz Regensburger | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 3 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 4 | Definition of the type -> of continuous functions. | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 5 | *) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 6 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 7 | header {* The type of continuous functions *}
 | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 8 | |
| 15577 | 9 | theory Cfun | 
| 25786 | 10 | imports Pcpodef Ffun | 
| 23152 | 11 | uses ("Tools/cont_proc.ML")
 | 
| 15577 | 12 | begin | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 13 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 14 | defaultsort cpo | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 15 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 16 | subsection {* Definition of continuous function type *}
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 17 | |
| 16699 | 18 | lemma Ex_cont: "\<exists>f. cont f" | 
| 19 | by (rule exI, rule cont_const) | |
| 20 | ||
| 21 | lemma adm_cont: "adm cont" | |
| 22 | by (rule admI, rule cont_lub_fun) | |
| 23 | ||
| 17817 | 24 | cpodef (CFun)  ('a, 'b) "->" (infixr "->" 0) = "{f::'a => 'b. cont f}"
 | 
| 29063 
7619f0561cd7
pcpodef package: state two goals, instead of encoded conjunction;
 wenzelm parents: 
29049diff
changeset | 25 | by (simp_all add: Ex_cont adm_cont) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 26 | |
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 27 | syntax (xsymbols) | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 28 |   "->"     :: "[type, type] => type"      ("(_ \<rightarrow>/ _)" [1,0]0)
 | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 29 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 30 | notation | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 31 |   Rep_CFun  ("(_$/_)" [999,1000] 999)
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 32 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 33 | notation (xsymbols) | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 34 |   Rep_CFun  ("(_\<cdot>/_)" [999,1000] 999)
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 35 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 36 | notation (HTML output) | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 37 |   Rep_CFun  ("(_\<cdot>/_)" [999,1000] 999)
 | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 38 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 39 | subsection {* Syntax for continuous lambda abstraction *}
 | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 40 | |
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 41 | syntax "_cabs" :: "'a" | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 42 | |
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 43 | parse_translation {*
 | 
| 18087 | 44 | (* rewrites (_cabs x t) => (Abs_CFun (%x. t)) *) | 
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 45 |   [mk_binder_tr ("_cabs", @{const_syntax Abs_CFun})];
 | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 46 | *} | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 47 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 48 | text {* To avoid eta-contraction of body: *}
 | 
| 18087 | 49 | typed_print_translation {*
 | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 50 | let | 
| 18087 | 51 | fun cabs_tr' _ _ [Abs abs] = let | 
| 52 | val (x,t) = atomic_abs_tr' abs | |
| 53 | in Syntax.const "_cabs" $ x $ t end | |
| 54 | ||
| 55 | | cabs_tr' _ T [t] = let | |
| 56 | val xT = domain_type (domain_type T); | |
| 57 |           val abs' = ("x",xT,(incr_boundvars 1 t)$Bound 0);
 | |
| 58 | val (x,t') = atomic_abs_tr' abs'; | |
| 59 | in Syntax.const "_cabs" $ x $ t' end; | |
| 60 | ||
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 61 |   in [(@{const_syntax Abs_CFun}, cabs_tr')] end;
 | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 62 | *} | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 63 | |
| 18087 | 64 | text {* Syntax for nested abstractions *}
 | 
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 65 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 66 | syntax | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 67 |   "_Lambda" :: "[cargs, 'a] \<Rightarrow> logic"  ("(3LAM _./ _)" [1000, 10] 10)
 | 
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 68 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 69 | syntax (xsymbols) | 
| 25927 | 70 |   "_Lambda" :: "[cargs, 'a] \<Rightarrow> logic" ("(3\<Lambda> _./ _)" [1000, 10] 10)
 | 
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 71 | |
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 72 | parse_ast_translation {*
 | 
| 18087 | 73 | (* rewrites (LAM x y z. t) => (_cabs x (_cabs y (_cabs z t))) *) | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 74 | (* cf. Syntax.lambda_ast_tr from Syntax/syn_trans.ML *) | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 75 | let | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 76 | fun Lambda_ast_tr [pats, body] = | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 77 | Syntax.fold_ast_p "_cabs" (Syntax.unfold_ast "_cargs" pats, body) | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 78 |       | Lambda_ast_tr asts = raise Syntax.AST ("Lambda_ast_tr", asts);
 | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 79 |   in [("_Lambda", Lambda_ast_tr)] end;
 | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 80 | *} | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 81 | |
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 82 | print_ast_translation {*
 | 
| 18087 | 83 | (* rewrites (_cabs x (_cabs y (_cabs z t))) => (LAM x y z. t) *) | 
| 18078 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 84 | (* cf. Syntax.abs_ast_tr' from Syntax/syn_trans.ML *) | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 85 | let | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 86 | fun cabs_ast_tr' asts = | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 87 | (case Syntax.unfold_ast_p "_cabs" | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 88 | (Syntax.Appl (Syntax.Constant "_cabs" :: asts)) of | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 89 |         ([], _) => raise Syntax.AST ("cabs_ast_tr'", asts)
 | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 90 | | (xs, body) => Syntax.Appl | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 91 | [Syntax.Constant "_Lambda", Syntax.fold_ast "_cargs" xs, body]); | 
| 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
 huffman parents: 
18076diff
changeset | 92 |   in [("_cabs", cabs_ast_tr')] end;
 | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 93 | *} | 
| 15641 | 94 | |
| 18087 | 95 | text {* Dummy patterns for continuous abstraction *}
 | 
| 18079 | 96 | translations | 
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 97 | "\<Lambda> _. t" => "CONST Abs_CFun (\<lambda> _. t)" | 
| 18087 | 98 | |
| 18079 | 99 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 100 | subsection {* Continuous function space is pointed *}
 | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 101 | |
| 16098 | 102 | lemma UU_CFun: "\<bottom> \<in> CFun" | 
| 103 | by (simp add: CFun_def inst_fun_pcpo cont_const) | |
| 104 | ||
| 25827 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 105 | instance "->" :: (finite_po, finite_po) finite_po | 
| 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 106 | by (rule typedef_finite_po [OF type_definition_CFun]) | 
| 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 107 | |
| 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 108 | instance "->" :: (finite_po, chfin) chfin | 
| 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 109 | by (rule typedef_chfin [OF type_definition_CFun less_CFun_def]) | 
| 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
 huffman parents: 
25786diff
changeset | 110 | |
| 26025 | 111 | instance "->" :: (cpo, discrete_cpo) discrete_cpo | 
| 112 | by intro_classes (simp add: less_CFun_def Rep_CFun_inject) | |
| 113 | ||
| 16098 | 114 | instance "->" :: (cpo, pcpo) pcpo | 
| 16920 | 115 | by (rule typedef_pcpo [OF type_definition_CFun less_CFun_def UU_CFun]) | 
| 16098 | 116 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 117 | lemmas Rep_CFun_strict = | 
| 16699 | 118 | typedef_Rep_strict [OF type_definition_CFun less_CFun_def UU_CFun] | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 119 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 120 | lemmas Abs_CFun_strict = | 
| 16699 | 121 | typedef_Abs_strict [OF type_definition_CFun less_CFun_def UU_CFun] | 
| 16098 | 122 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 123 | text {* function application is strict in its first argument *}
 | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 124 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 125 | lemma Rep_CFun_strict1 [simp]: "\<bottom>\<cdot>x = \<bottom>" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 126 | by (simp add: Rep_CFun_strict) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 127 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 128 | text {* for compatibility with old HOLCF-Version *}
 | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 129 | lemma inst_cfun_pcpo: "\<bottom> = (\<Lambda> x. \<bottom>)" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 130 | by (simp add: inst_fun_pcpo [symmetric] Abs_CFun_strict) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 131 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 132 | subsection {* Basic properties of continuous functions *}
 | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 133 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 134 | text {* Beta-equality for continuous functions *}
 | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 135 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 136 | lemma Abs_CFun_inverse2: "cont f \<Longrightarrow> Rep_CFun (Abs_CFun f) = f" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 137 | by (simp add: Abs_CFun_inverse CFun_def) | 
| 16098 | 138 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 139 | lemma beta_cfun [simp]: "cont f \<Longrightarrow> (\<Lambda> x. f x)\<cdot>u = f u" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 140 | by (simp add: Abs_CFun_inverse2) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 141 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 142 | text {* Eta-equality for continuous functions *}
 | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 143 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 144 | lemma eta_cfun: "(\<Lambda> x. f\<cdot>x) = f" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 145 | by (rule Rep_CFun_inverse) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 146 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 147 | text {* Extensionality for continuous functions *}
 | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 148 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 149 | lemma expand_cfun_eq: "(f = g) = (\<forall>x. f\<cdot>x = g\<cdot>x)" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 150 | by (simp add: Rep_CFun_inject [symmetric] expand_fun_eq) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 151 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 152 | lemma ext_cfun: "(\<And>x. f\<cdot>x = g\<cdot>x) \<Longrightarrow> f = g" | 
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 153 | by (simp add: expand_cfun_eq) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 154 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 155 | text {* Extensionality wrt. ordering for continuous functions *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 156 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 157 | lemma expand_cfun_less: "f \<sqsubseteq> g = (\<forall>x. f\<cdot>x \<sqsubseteq> g\<cdot>x)" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 158 | by (simp add: less_CFun_def expand_fun_less) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 159 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 160 | lemma less_cfun_ext: "(\<And>x. f\<cdot>x \<sqsubseteq> g\<cdot>x) \<Longrightarrow> f \<sqsubseteq> g" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 161 | by (simp add: expand_cfun_less) | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 162 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 163 | text {* Congruence for continuous function application *}
 | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 164 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 165 | lemma cfun_cong: "\<lbrakk>f = g; x = y\<rbrakk> \<Longrightarrow> f\<cdot>x = g\<cdot>y" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 166 | by simp | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 167 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 168 | lemma cfun_fun_cong: "f = g \<Longrightarrow> f\<cdot>x = g\<cdot>x" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 169 | by simp | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 170 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 171 | lemma cfun_arg_cong: "x = y \<Longrightarrow> f\<cdot>x = f\<cdot>y" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 172 | by simp | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 173 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 174 | subsection {* Continuity of application *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 175 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 176 | lemma cont_Rep_CFun1: "cont (\<lambda>f. f\<cdot>x)" | 
| 18092 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 177 | by (rule cont_Rep_CFun [THEN cont2cont_fun]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 178 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 179 | lemma cont_Rep_CFun2: "cont (\<lambda>x. f\<cdot>x)" | 
| 18092 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 180 | apply (cut_tac x=f in Rep_CFun) | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 181 | apply (simp add: CFun_def) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 182 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 183 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 184 | lemmas monofun_Rep_CFun = cont_Rep_CFun [THEN cont2mono] | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 185 | lemmas contlub_Rep_CFun = cont_Rep_CFun [THEN cont2contlub] | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 186 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 187 | lemmas monofun_Rep_CFun1 = cont_Rep_CFun1 [THEN cont2mono, standard] | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 188 | lemmas contlub_Rep_CFun1 = cont_Rep_CFun1 [THEN cont2contlub, standard] | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 189 | lemmas monofun_Rep_CFun2 = cont_Rep_CFun2 [THEN cont2mono, standard] | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 190 | lemmas contlub_Rep_CFun2 = cont_Rep_CFun2 [THEN cont2contlub, standard] | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 191 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 192 | text {* contlub, cont properties of @{term Rep_CFun} in each argument *}
 | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 193 | |
| 27413 | 194 | lemma contlub_cfun_arg: "chain Y \<Longrightarrow> f\<cdot>(\<Squnion>i. Y i) = (\<Squnion>i. f\<cdot>(Y i))" | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 195 | by (rule contlub_Rep_CFun2 [THEN contlubE]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 196 | |
| 27413 | 197 | lemma cont_cfun_arg: "chain Y \<Longrightarrow> range (\<lambda>i. f\<cdot>(Y i)) <<| f\<cdot>(\<Squnion>i. Y i)" | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 198 | by (rule cont_Rep_CFun2 [THEN contE]) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 199 | |
| 27413 | 200 | lemma contlub_cfun_fun: "chain F \<Longrightarrow> (\<Squnion>i. F i)\<cdot>x = (\<Squnion>i. F i\<cdot>x)" | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 201 | by (rule contlub_Rep_CFun1 [THEN contlubE]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 202 | |
| 27413 | 203 | lemma cont_cfun_fun: "chain F \<Longrightarrow> range (\<lambda>i. F i\<cdot>x) <<| (\<Squnion>i. F i)\<cdot>x" | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 204 | by (rule cont_Rep_CFun1 [THEN contE]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 205 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 206 | text {* monotonicity of application *}
 | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 207 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 208 | lemma monofun_cfun_fun: "f \<sqsubseteq> g \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>x" | 
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 209 | by (simp add: expand_cfun_less) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 210 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 211 | lemma monofun_cfun_arg: "x \<sqsubseteq> y \<Longrightarrow> f\<cdot>x \<sqsubseteq> f\<cdot>y" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 212 | by (rule monofun_Rep_CFun2 [THEN monofunE]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 213 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 214 | lemma monofun_cfun: "\<lbrakk>f \<sqsubseteq> g; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>y" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 215 | by (rule trans_less [OF monofun_cfun_fun monofun_cfun_arg]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 216 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 217 | text {* ch2ch - rules for the type @{typ "'a -> 'b"} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 218 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 219 | lemma chain_monofun: "chain Y \<Longrightarrow> chain (\<lambda>i. f\<cdot>(Y i))" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 220 | by (erule monofun_Rep_CFun2 [THEN ch2ch_monofun]) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 221 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 222 | lemma ch2ch_Rep_CFunR: "chain Y \<Longrightarrow> chain (\<lambda>i. f\<cdot>(Y i))" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 223 | by (rule monofun_Rep_CFun2 [THEN ch2ch_monofun]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 224 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 225 | lemma ch2ch_Rep_CFunL: "chain F \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>x)" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 226 | by (rule monofun_Rep_CFun1 [THEN ch2ch_monofun]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 227 | |
| 18076 | 228 | lemma ch2ch_Rep_CFun [simp]: | 
| 229 | "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>(Y i))" | |
| 25884 | 230 | by (simp add: chain_def monofun_cfun) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 231 | |
| 25884 | 232 | lemma ch2ch_LAM [simp]: | 
| 233 | "\<lbrakk>\<And>x. chain (\<lambda>i. S i x); \<And>i. cont (\<lambda>x. S i x)\<rbrakk> \<Longrightarrow> chain (\<lambda>i. \<Lambda> x. S i x)" | |
| 18092 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 234 | by (simp add: chain_def expand_cfun_less) | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 235 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 236 | text {* contlub, cont properties of @{term Rep_CFun} in both arguments *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 237 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 238 | lemma contlub_cfun: | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 239 | "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. F i)\<cdot>(\<Squnion>i. Y i) = (\<Squnion>i. F i\<cdot>(Y i))" | 
| 18076 | 240 | by (simp add: contlub_cfun_fun contlub_cfun_arg diag_lub) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 241 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 242 | lemma cont_cfun: | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 243 | "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> range (\<lambda>i. F i\<cdot>(Y i)) <<| (\<Squnion>i. F i)\<cdot>(\<Squnion>i. Y i)" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 244 | apply (rule thelubE) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 245 | apply (simp only: ch2ch_Rep_CFun) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 246 | apply (simp only: contlub_cfun) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 247 | done | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 248 | |
| 18092 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 249 | lemma contlub_LAM: | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 250 | "\<lbrakk>\<And>x. chain (\<lambda>i. F i x); \<And>i. cont (\<lambda>x. F i x)\<rbrakk> | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 251 | \<Longrightarrow> (\<Lambda> x. \<Squnion>i. F i x) = (\<Squnion>i. \<Lambda> x. F i x)" | 
| 25884 | 252 | apply (simp add: thelub_CFun) | 
| 18092 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 253 | apply (simp add: Abs_CFun_inverse2) | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 254 | apply (simp add: thelub_fun ch2ch_lambda) | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 255 | done | 
| 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
 huffman parents: 
18091diff
changeset | 256 | |
| 25901 | 257 | lemmas lub_distribs = | 
| 258 | contlub_cfun [symmetric] | |
| 259 | contlub_LAM [symmetric] | |
| 260 | ||
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 261 | text {* strictness *}
 | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 262 | |
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 263 | lemma strictI: "f\<cdot>x = \<bottom> \<Longrightarrow> f\<cdot>\<bottom> = \<bottom>" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 264 | apply (rule UU_I) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 265 | apply (erule subst) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 266 | apply (rule minimal [THEN monofun_cfun_arg]) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 267 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 268 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 269 | text {* the lub of a chain of continous functions is monotone *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 270 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 271 | lemma lub_cfun_mono: "chain F \<Longrightarrow> monofun (\<lambda>x. \<Squnion>i. F i\<cdot>x)" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 272 | apply (drule ch2ch_monofun [OF monofun_Rep_CFun]) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 273 | apply (simp add: thelub_fun [symmetric]) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 274 | apply (erule monofun_lub_fun) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 275 | apply (simp add: monofun_Rep_CFun2) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 276 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 277 | |
| 16386 | 278 | text {* a lemma about the exchange of lubs for type @{typ "'a -> 'b"} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 279 | |
| 16699 | 280 | lemma ex_lub_cfun: | 
| 281 | "\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> (\<Squnion>j. \<Squnion>i. F j\<cdot>(Y i)) = (\<Squnion>i. \<Squnion>j. F j\<cdot>(Y i))" | |
| 18076 | 282 | by (simp add: diag_lub) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 283 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 284 | text {* the lub of a chain of cont. functions is continuous *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 285 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 286 | lemma cont_lub_cfun: "chain F \<Longrightarrow> cont (\<lambda>x. \<Squnion>i. F i\<cdot>x)" | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 287 | apply (rule cont2cont_lub) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 288 | apply (erule monofun_Rep_CFun [THEN ch2ch_monofun]) | 
| 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 289 | apply (rule cont_Rep_CFun2) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 290 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 291 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 292 | text {* type @{typ "'a -> 'b"} is chain complete *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 293 | |
| 16920 | 294 | lemma lub_cfun: "chain F \<Longrightarrow> range F <<| (\<Lambda> x. \<Squnion>i. F i\<cdot>x)" | 
| 295 | by (simp only: contlub_cfun_fun [symmetric] eta_cfun thelubE) | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 296 | |
| 27413 | 297 | lemma thelub_cfun: "chain F \<Longrightarrow> (\<Squnion>i. F i) = (\<Lambda> x. \<Squnion>i. F i\<cdot>x)" | 
| 16920 | 298 | by (rule lub_cfun [THEN thelubI]) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 299 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 300 | subsection {* Continuity simplification procedure *}
 | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 301 | |
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 302 | text {* cont2cont lemma for @{term Rep_CFun} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 303 | |
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 304 | lemma cont2cont_Rep_CFun: | 
| 29049 | 305 | assumes f: "cont (\<lambda>x. f x)" | 
| 306 | assumes t: "cont (\<lambda>x. t x)" | |
| 307 | shows "cont (\<lambda>x. (f x)\<cdot>(t x))" | |
| 308 | proof - | |
| 309 | have "cont (\<lambda>x. Rep_CFun (f x))" | |
| 310 | using cont_Rep_CFun f by (rule cont2cont_app3) | |
| 311 | thus "cont (\<lambda>x. (f x)\<cdot>(t x))" | |
| 312 | using cont_Rep_CFun2 t by (rule cont2cont_app2) | |
| 313 | qed | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 314 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 315 | text {* cont2mono Lemma for @{term "%x. LAM y. c1(x)(y)"} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 316 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 317 | lemma cont2mono_LAM: | 
| 29049 | 318 | "\<lbrakk>\<And>x. cont (\<lambda>y. f x y); \<And>y. monofun (\<lambda>x. f x y)\<rbrakk> | 
| 319 | \<Longrightarrow> monofun (\<lambda>x. \<Lambda> y. f x y)" | |
| 320 | unfolding monofun_def expand_cfun_less by simp | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 321 | |
| 29049 | 322 | text {* cont2cont Lemma for @{term "%x. LAM y. f x y"} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 323 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 324 | lemma cont2cont_LAM: | 
| 29049 | 325 | assumes f1: "\<And>x. cont (\<lambda>y. f x y)" | 
| 326 | assumes f2: "\<And>y. cont (\<lambda>x. f x y)" | |
| 327 | shows "cont (\<lambda>x. \<Lambda> y. f x y)" | |
| 328 | proof (rule cont_Abs_CFun) | |
| 329 | fix x | |
| 330 | from f1 show "f x \<in> CFun" by (simp add: CFun_def) | |
| 331 | from f2 show "cont f" by (rule cont2cont_lambda) | |
| 332 | qed | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 333 | |
| 16386 | 334 | text {* continuity simplification procedure *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 335 | |
| 16055 | 336 | lemmas cont_lemmas1 = | 
| 337 | cont_const cont_id cont_Rep_CFun2 cont2cont_Rep_CFun cont2cont_LAM | |
| 338 | ||
| 23152 | 339 | use "Tools/cont_proc.ML"; | 
| 16386 | 340 | setup ContProc.setup; | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 341 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 342 | (*val cont_tac = (fn i => (resolve_tac cont_lemmas i));*) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 343 | (*val cont_tacR = (fn i => (REPEAT (cont_tac i)));*) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 344 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 345 | subsection {* Miscellaneous *}
 | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 346 | |
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 347 | text {* Monotonicity of @{term Abs_CFun} *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 348 | |
| 17832 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 349 | lemma semi_monofun_Abs_CFun: | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 350 | "\<lbrakk>cont f; cont g; f \<sqsubseteq> g\<rbrakk> \<Longrightarrow> Abs_CFun f \<sqsubseteq> Abs_CFun g" | 
| 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
 huffman parents: 
17817diff
changeset | 351 | by (simp add: less_CFun_def Abs_CFun_inverse2) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 352 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 353 | text {* some lemmata for functions with flat/chfin domain/range types *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 354 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 355 | lemma chfin_Rep_CFunR: "chain (Y::nat => 'a::cpo->'b::chfin) | 
| 27413 | 356 | ==> !s. ? n. (LUB i. Y i)$s = Y n$s" | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 357 | apply (rule allI) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 358 | apply (subst contlub_cfun_fun) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 359 | apply assumption | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 360 | apply (fast intro!: thelubI chfin lub_finch2 chfin2finch ch2ch_Rep_CFunL) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 361 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 362 | |
| 18089 | 363 | lemma adm_chfindom: "adm (\<lambda>(u::'a::cpo \<rightarrow> 'b::chfin). P(u\<cdot>s))" | 
| 364 | by (rule adm_subst, simp, rule adm_chfin) | |
| 365 | ||
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 366 | subsection {* Continuous injection-retraction pairs *}
 | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 367 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 368 | text {* Continuous retractions are strict. *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 369 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 370 | lemma retraction_strict: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 371 | "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> f\<cdot>\<bottom> = \<bottom>" | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 372 | apply (rule UU_I) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 373 | apply (drule_tac x="\<bottom>" in spec) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 374 | apply (erule subst) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 375 | apply (rule monofun_cfun_arg) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 376 | apply (rule minimal) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 377 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 378 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 379 | lemma injection_eq: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 380 | "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> (g\<cdot>x = g\<cdot>y) = (x = y)" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 381 | apply (rule iffI) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 382 | apply (drule_tac f=f in cfun_arg_cong) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 383 | apply simp | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 384 | apply simp | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 385 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 386 | |
| 16314 | 387 | lemma injection_less: | 
| 388 | "\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> (g\<cdot>x \<sqsubseteq> g\<cdot>y) = (x \<sqsubseteq> y)" | |
| 389 | apply (rule iffI) | |
| 390 | apply (drule_tac f=f in monofun_cfun_arg) | |
| 391 | apply simp | |
| 392 | apply (erule monofun_cfun_arg) | |
| 393 | done | |
| 394 | ||
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 395 | lemma injection_defined_rev: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 396 | "\<lbrakk>\<forall>x. f\<cdot>(g\<cdot>x) = x; g\<cdot>z = \<bottom>\<rbrakk> \<Longrightarrow> z = \<bottom>" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 397 | apply (drule_tac f=f in cfun_arg_cong) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 398 | apply (simp add: retraction_strict) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 399 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 400 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 401 | lemma injection_defined: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 402 | "\<lbrakk>\<forall>x. f\<cdot>(g\<cdot>x) = x; z \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> g\<cdot>z \<noteq> \<bottom>" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 403 | by (erule contrapos_nn, rule injection_defined_rev) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 404 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 405 | text {* propagation of flatness and chain-finiteness by retractions *}
 | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 406 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 407 | lemma chfin2chfin: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 408 | "\<forall>y. (f::'a::chfin \<rightarrow> 'b)\<cdot>(g\<cdot>y) = y | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 409 | \<Longrightarrow> \<forall>Y::nat \<Rightarrow> 'b. chain Y \<longrightarrow> (\<exists>n. max_in_chain n Y)" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 410 | apply clarify | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 411 | apply (drule_tac f=g in chain_monofun) | 
| 25921 | 412 | apply (drule chfin) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 413 | apply (unfold max_in_chain_def) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 414 | apply (simp add: injection_eq) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 415 | done | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 416 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 417 | lemma flat2flat: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 418 | "\<forall>y. (f::'a::flat \<rightarrow> 'b::pcpo)\<cdot>(g\<cdot>y) = y | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 419 | \<Longrightarrow> \<forall>x y::'b. x \<sqsubseteq> y \<longrightarrow> x = \<bottom> \<or> x = y" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 420 | apply clarify | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 421 | apply (drule_tac f=g in monofun_cfun_arg) | 
| 25920 | 422 | apply (drule ax_flat) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 423 | apply (erule disjE) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 424 | apply (simp add: injection_defined_rev) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 425 | apply (simp add: injection_eq) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 426 | done | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 427 | |
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 428 | text {* a result about functions with flat codomain *}
 | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 429 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 430 | lemma flat_eqI: "\<lbrakk>(x::'a::flat) \<sqsubseteq> y; x \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> x = y" | 
| 25920 | 431 | by (drule ax_flat, simp) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 432 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 433 | lemma flat_codom: | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 434 | "f\<cdot>x = (c::'b::flat) \<Longrightarrow> f\<cdot>\<bottom> = \<bottom> \<or> (\<forall>z. f\<cdot>z = c)" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 435 | apply (case_tac "f\<cdot>x = \<bottom>") | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 436 | apply (rule disjI1) | 
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 437 | apply (rule UU_I) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 438 | apply (erule_tac t="\<bottom>" in subst) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 439 | apply (rule minimal [THEN monofun_cfun_arg]) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 440 | apply clarify | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 441 | apply (rule_tac a = "f\<cdot>\<bottom>" in refl [THEN box_equals]) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 442 | apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI]) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 443 | apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI]) | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 444 | done | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 445 | |
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 446 | |
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 447 | subsection {* Identity and composition *}
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 448 | |
| 25135 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 449 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 450 | ID :: "'a \<rightarrow> 'a" where | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 451 | "ID = (\<Lambda> x. x)" | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 452 | |
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 453 | definition | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 454 |   cfcomp  :: "('b \<rightarrow> 'c) \<rightarrow> ('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'c" where
 | 
| 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
 wenzelm parents: 
25131diff
changeset | 455 | oo_def: "cfcomp = (\<Lambda> f g x. f\<cdot>(g\<cdot>x))" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 456 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 457 | abbreviation | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 458 | cfcomp_syn :: "['b \<rightarrow> 'c, 'a \<rightarrow> 'b] \<Rightarrow> 'a \<rightarrow> 'c" (infixr "oo" 100) where | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 459 | "f oo g == cfcomp\<cdot>f\<cdot>g" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 460 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 461 | lemma ID1 [simp]: "ID\<cdot>x = x" | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 462 | by (simp add: ID_def) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 463 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 464 | lemma cfcomp1: "(f oo g) = (\<Lambda> x. f\<cdot>(g\<cdot>x))" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 465 | by (simp add: oo_def) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 466 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 467 | lemma cfcomp2 [simp]: "(f oo g)\<cdot>x = f\<cdot>(g\<cdot>x)" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 468 | by (simp add: cfcomp1) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 469 | |
| 27274 | 470 | lemma cfcomp_LAM: "cont g \<Longrightarrow> f oo (\<Lambda> x. g x) = (\<Lambda> x. f\<cdot>(g x))" | 
| 471 | by (simp add: cfcomp1) | |
| 472 | ||
| 19709 | 473 | lemma cfcomp_strict [simp]: "\<bottom> oo f = \<bottom>" | 
| 474 | by (simp add: expand_cfun_eq) | |
| 475 | ||
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 476 | text {*
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 477 |   Show that interpretation of (pcpo,@{text "_->_"}) is a category.
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 478 | The class of objects is interpretation of syntactical class pcpo. | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 479 |   The class of arrows  between objects @{typ 'a} and @{typ 'b} is interpret. of @{typ "'a -> 'b"}.
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 480 |   The identity arrow is interpretation of @{term ID}.
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 481 |   The composition of f and g is interpretation of @{text "oo"}.
 | 
| 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 482 | *} | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 483 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 484 | lemma ID2 [simp]: "f oo ID = f" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 485 | by (rule ext_cfun, simp) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 486 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 487 | lemma ID3 [simp]: "ID oo f = f" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 488 | by (rule ext_cfun, simp) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 489 | |
| 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 490 | lemma assoc_oo: "f oo (g oo h) = (f oo g) oo h" | 
| 15589 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
 huffman parents: 
15577diff
changeset | 491 | by (rule ext_cfun, simp) | 
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 492 | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 493 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 494 | subsection {* Strictified functions *}
 | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 495 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 496 | defaultsort pcpo | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 497 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 498 | definition | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 499 |   strictify  :: "('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'b" where
 | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 500 | "strictify = (\<Lambda> f x. if x = \<bottom> then \<bottom> else f\<cdot>x)" | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 501 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 502 | text {* results about strictify *}
 | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 503 | |
| 17815 | 504 | lemma cont_strictify1: "cont (\<lambda>f. if x = \<bottom> then \<bottom> else f\<cdot>x)" | 
| 505 | by (simp add: cont_if) | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 506 | |
| 17815 | 507 | lemma monofun_strictify2: "monofun (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)" | 
| 508 | apply (rule monofunI) | |
| 25786 | 509 | apply (auto simp add: monofun_cfun_arg) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 510 | done | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 511 | |
| 17815 | 512 | (*FIXME: long proof*) | 
| 25723 | 513 | lemma contlub_strictify2: "contlub (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)" | 
| 16209 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
 huffman parents: 
16098diff
changeset | 514 | apply (rule contlubI) | 
| 27413 | 515 | apply (case_tac "(\<Squnion>i. Y i) = \<bottom>") | 
| 16699 | 516 | apply (drule (1) chain_UU_I) | 
| 18076 | 517 | apply simp | 
| 17815 | 518 | apply (simp del: if_image_distrib) | 
| 519 | apply (simp only: contlub_cfun_arg) | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 520 | apply (rule lub_equal2) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 521 | apply (rule chain_mono2 [THEN exE]) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 522 | apply (erule chain_UU_I_inverse2) | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 523 | apply (assumption) | 
| 17815 | 524 | apply (rule_tac x=x in exI, clarsimp) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 525 | apply (erule chain_monofun) | 
| 17815 | 526 | apply (erule monofun_strictify2 [THEN ch2ch_monofun]) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 527 | done | 
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 528 | |
| 17815 | 529 | lemmas cont_strictify2 = | 
| 530 | monocontlub2cont [OF monofun_strictify2 contlub_strictify2, standard] | |
| 531 | ||
| 532 | lemma strictify_conv_if: "strictify\<cdot>f\<cdot>x = (if x = \<bottom> then \<bottom> else f\<cdot>x)" | |
| 533 | by (unfold strictify_def, simp add: cont_strictify1 cont_strictify2) | |
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 534 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 535 | lemma strictify1 [simp]: "strictify\<cdot>f\<cdot>\<bottom> = \<bottom>" | 
| 17815 | 536 | by (simp add: strictify_conv_if) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 537 | |
| 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 538 | lemma strictify2 [simp]: "x \<noteq> \<bottom> \<Longrightarrow> strictify\<cdot>f\<cdot>x = f\<cdot>x" | 
| 17815 | 539 | by (simp add: strictify_conv_if) | 
| 16085 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
 huffman parents: 
16070diff
changeset | 540 | |
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 541 | subsection {* Continuous let-bindings *}
 | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 542 | |
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 543 | definition | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 544 |   CLet :: "'a \<rightarrow> ('a \<rightarrow> 'b) \<rightarrow> 'b" where
 | 
| 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 545 | "CLet = (\<Lambda> s f. f\<cdot>s)" | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 546 | |
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 547 | syntax | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 548 |   "_CLet" :: "[letbinds, 'a] => 'a" ("(Let (_)/ in (_))" 10)
 | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 549 | |
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 550 | translations | 
| 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 551 | "_CLet (_binds b bs) e" == "_CLet b (_CLet bs e)" | 
| 25131 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
 wenzelm parents: 
23152diff
changeset | 552 | "Let x = a in e" == "CONST CLet\<cdot>a\<cdot>(\<Lambda> x. e)" | 
| 17816 
9942c5ed866a
new syntax translations for continuous lambda abstraction
 huffman parents: 
17815diff
changeset | 553 | |
| 15576 
efb95d0d01f7
converted to new-style theories, and combined numbered files
 huffman parents: diff
changeset | 554 | end |