author  huffman 
Sat, 22 May 2010 13:40:15 0700  
changeset 37083  03a70ab79dd9 
parent 37079  0cd15d8c90a0 
child 39145  154fd9c06c63 
permissions  rwrr 
15600  1 
(* Title: HOLCF/Cfun.thy 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

2 
Author: Franz Regensburger 
35794  3 
Author: Brian Huffman 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

4 
*) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

5 

efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

6 
header {* The type of continuous functions *} 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

7 

15577  8 
theory Cfun 
29533  9 
imports Pcpodef Ffun Product_Cpo 
15577  10 
begin 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

11 

36452  12 
default_sort cpo 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

13 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

14 
subsection {* Definition of continuous function type *} 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

15 

16699  16 
lemma Ex_cont: "\<exists>f. cont f" 
17 
by (rule exI, rule cont_const) 

18 

19 
lemma adm_cont: "adm cont" 

20 
by (rule admI, rule cont_lub_fun) 

21 

35525  22 
cpodef (CFun) ('a, 'b) cfun (infixr ">" 0) = "{f::'a => 'b. cont f}" 
29063
7619f0561cd7
pcpodef package: state two goals, instead of encoded conjunction;
wenzelm
parents:
29049
diff
changeset

23 
by (simp_all add: Ex_cont adm_cont) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

24 

35427  25 
type_notation (xsymbols) 
35525  26 
cfun ("(_ \<rightarrow>/ _)" [1, 0] 0) 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

27 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

28 
notation 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

29 
Rep_CFun ("(_$/_)" [999,1000] 999) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

30 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

31 
notation (xsymbols) 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

32 
Rep_CFun ("(_\<cdot>/_)" [999,1000] 999) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

33 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

34 
notation (HTML output) 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

35 
Rep_CFun ("(_\<cdot>/_)" [999,1000] 999) 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

36 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

37 
subsection {* Syntax for continuous lambda abstraction *} 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

38 

18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

39 
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:
18076
diff
changeset

40 

20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

41 
parse_translation {* 
35115  42 
(* rewrite (_cabs x t) => (Abs_CFun (%x. t)) *) 
43 
[mk_binder_tr (@{syntax_const "_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:
18076
diff
changeset

44 
*} 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

45 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

46 
text {* To avoid etacontraction of body: *} 
18087  47 
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:
18076
diff
changeset

48 
let 
18087  49 
fun cabs_tr' _ _ [Abs abs] = let 
50 
val (x,t) = atomic_abs_tr' abs 

35115  51 
in Syntax.const @{syntax_const "_cabs"} $ x $ t end 
18087  52 

53 
 cabs_tr' _ T [t] = let 

54 
val xT = domain_type (domain_type T); 

55 
val abs' = ("x",xT,(incr_boundvars 1 t)$Bound 0); 

56 
val (x,t') = atomic_abs_tr' abs'; 

35115  57 
in Syntax.const @{syntax_const "_cabs"} $ x $ t' end; 
18087  58 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

59 
in [(@{const_syntax Abs_CFun}, cabs_tr')] end; 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

60 
*} 
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

61 

18087  62 
text {* Syntax for nested abstractions *} 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

63 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

64 
syntax 
18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

65 
"_Lambda" :: "[cargs, 'a] \<Rightarrow> logic" ("(3LAM _./ _)" [1000, 10] 10) 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

66 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

67 
syntax (xsymbols) 
25927  68 
"_Lambda" :: "[cargs, 'a] \<Rightarrow> logic" ("(3\<Lambda> _./ _)" [1000, 10] 10) 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

69 

17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

70 
parse_ast_translation {* 
35115  71 
(* rewrite (LAM x y z. t) => (_cabs x (_cabs y (_cabs z t))) *) 
72 
(* cf. Syntax.lambda_ast_tr from src/Pure/Syntax/syn_trans.ML *) 

18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

73 
let 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

74 
fun Lambda_ast_tr [pats, body] = 
35115  75 
Syntax.fold_ast_p @{syntax_const "_cabs"} 
76 
(Syntax.unfold_ast @{syntax_const "_cargs"} pats, body) 

18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

77 
 Lambda_ast_tr asts = raise Syntax.AST ("Lambda_ast_tr", asts); 
35115  78 
in [(@{syntax_const "_Lambda"}, Lambda_ast_tr)] end; 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

79 
*} 
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

80 

9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

81 
print_ast_translation {* 
35115  82 
(* rewrite (_cabs x (_cabs y (_cabs z t))) => (LAM x y z. t) *) 
83 
(* cf. Syntax.abs_ast_tr' from src/Pure/Syntax/syn_trans.ML *) 

18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

84 
let 
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

85 
fun cabs_ast_tr' asts = 
35115  86 
(case Syntax.unfold_ast_p @{syntax_const "_cabs"} 
87 
(Syntax.Appl (Syntax.Constant @{syntax_const "_cabs"} :: asts)) of 

18078
20e5a6440790
change syntax for LAM to use expressions as patterns; define LAM pattern syntax for cpair, spair, sinl, sinr, up
huffman
parents:
18076
diff
changeset

88 
([], _) => 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:
18076
diff
changeset

89 
 (xs, body) => Syntax.Appl 
35115  90 
[Syntax.Constant @{syntax_const "_Lambda"}, 
91 
Syntax.fold_ast @{syntax_const "_cargs"} xs, body]); 

92 
in [(@{syntax_const "_cabs"}, cabs_ast_tr')] end 

17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

93 
*} 
15641  94 

18087  95 
text {* Dummy patterns for continuous abstraction *} 
18079  96 
translations 
25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
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:
17817
diff
changeset

100 
subsection {* Continuous function space is pointed *} 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

101 

16098  102 
lemma UU_CFun: "\<bottom> \<in> CFun" 
37079
0cd15d8c90a0
remove cont2cont simproc; instead declare cont2cont rules as simp rules
huffman
parents:
36452
diff
changeset

103 
by (simp add: CFun_def inst_fun_pcpo) 
16098  104 

35525  105 
instance cfun :: (finite_po, finite_po) finite_po 
25827
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
25786
diff
changeset

106 
by (rule typedef_finite_po [OF type_definition_CFun]) 
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
25786
diff
changeset

107 

35525  108 
instance cfun :: (finite_po, chfin) chfin 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

109 
by (rule typedef_chfin [OF type_definition_CFun below_CFun_def]) 
25827
c2adeb1bae5c
new instance proofs for classes finite_po, chfin, flat
huffman
parents:
25786
diff
changeset

110 

35525  111 
instance cfun :: (cpo, discrete_cpo) discrete_cpo 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

112 
by intro_classes (simp add: below_CFun_def Rep_CFun_inject) 
26025  113 

35525  114 
instance cfun :: (cpo, pcpo) pcpo 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

115 
by (rule typedef_pcpo [OF type_definition_CFun below_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:
16098
diff
changeset

117 
lemmas Rep_CFun_strict = 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

118 
typedef_Rep_strict [OF type_definition_CFun below_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:
16098
diff
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:
16098
diff
changeset

120 
lemmas Abs_CFun_strict = 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

121 
typedef_Abs_strict [OF type_definition_CFun below_CFun_def UU_CFun] 
16098  122 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

123 
text {* function application is strict in its first argument *} 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

124 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

125 
lemma Rep_CFun_strict1 [simp]: "\<bottom>\<cdot>x = \<bottom>" 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

126 
by (simp add: Rep_CFun_strict) 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

127 

35641  128 
lemma LAM_strict [simp]: "(\<Lambda> x. \<bottom>) = \<bottom>" 
129 
by (simp add: inst_fun_pcpo [symmetric] Abs_CFun_strict) 

130 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

131 
text {* for compatibility with old HOLCFVersion *} 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

132 
lemma inst_cfun_pcpo: "\<bottom> = (\<Lambda> x. \<bottom>)" 
35641  133 
by simp 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

134 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

135 
subsection {* Basic properties of continuous functions *} 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

136 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

137 
text {* Betaequality 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:
16098
diff
changeset

138 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

139 
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:
16098
diff
changeset

140 
by (simp add: Abs_CFun_inverse CFun_def) 
16098  141 

37083
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

142 
lemma beta_cfun: "cont f \<Longrightarrow> (\<Lambda> x. f x)\<cdot>u = f u" 
16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

143 
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:
16098
diff
changeset

144 

37083
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

145 
text {* Betareduction simproc *} 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

146 

03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

147 
text {* 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

148 
Given the term @{term "(\<Lambda> x. f x)\<cdot>y"}, the procedure tries to 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

149 
construct the theorem @{term "(\<Lambda> x. f x)\<cdot>y == f y"}. If this 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

150 
theorem cannot be completely solved by the cont2cont rules, then 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

151 
the procedure returns the ordinary conditional @{text beta_cfun} 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

152 
rule. 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

153 

03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

154 
The simproc does not solve any more goals that would be solved by 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

155 
using @{text beta_cfun} as a simp rule. The advantage of the 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

156 
simproc is that it can avoid deeplynested calls to the simplifier 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

157 
that would otherwise be caused by large continuity side conditions. 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

158 
*} 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

159 

03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

160 
simproc_setup beta_cfun_proc ("Abs_CFun f\<cdot>x") = {* 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

161 
fn phi => fn ss => fn ct => 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

162 
let 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

163 
val dest = Thm.dest_comb; 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

164 
val (f, x) = (apfst (snd o dest o snd o dest) o dest) ct; 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

165 
val [T, U] = Thm.dest_ctyp (ctyp_of_term f); 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

166 
val tr = instantiate' [SOME T, SOME U] [SOME f, SOME x] 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

167 
(mk_meta_eq @{thm beta_cfun}); 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

168 
val rules = Cont2ContData.get (Simplifier.the_context ss); 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

169 
val tac = SOLVED' (REPEAT_ALL_NEW (match_tac rules)); 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

170 
in SOME (perhaps (SINGLE (tac 1)) tr) end 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

171 
*} 
03a70ab79dd9
add beta_cfun simproc, which uses cont2cont rules
huffman
parents:
37079
diff
changeset

172 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

173 
text {* Etaequality 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:
16098
diff
changeset

174 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

175 
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:
16098
diff
changeset

176 
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:
16098
diff
changeset

177 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

178 
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:
16098
diff
changeset

179 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

180 
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:
17817
diff
changeset

181 
by (simp add: Rep_CFun_inject [symmetric] expand_fun_eq) 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

182 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

183 
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:
17817
diff
changeset

184 
by (simp add: expand_cfun_eq) 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

185 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

186 
text {* Extensionality wrt. ordering for continuous functions *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

187 

31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

188 
lemma expand_cfun_below: "f \<sqsubseteq> g = (\<forall>x. f\<cdot>x \<sqsubseteq> g\<cdot>x)" 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

189 
by (simp add: below_CFun_def expand_fun_below) 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

190 

31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

191 
lemma below_cfun_ext: "(\<And>x. f\<cdot>x \<sqsubseteq> g\<cdot>x) \<Longrightarrow> f \<sqsubseteq> g" 
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

192 
by (simp add: expand_cfun_below) 
17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

193 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

194 
text {* Congruence for continuous function application *} 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

195 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

196 
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:
15577
diff
changeset

197 
by simp 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

198 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

199 
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:
15577
diff
changeset

200 
by simp 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

201 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

202 
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:
15577
diff
changeset

203 
by simp 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

204 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

205 
subsection {* Continuity of application *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

206 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

207 
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:
18091
diff
changeset

208 
by (rule cont_Rep_CFun [THEN cont2cont_fun]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

209 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

210 
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:
18091
diff
changeset

211 
apply (cut_tac x=f in Rep_CFun) 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

212 
apply (simp add: CFun_def) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

213 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

214 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

215 
lemmas monofun_Rep_CFun = cont_Rep_CFun [THEN cont2mono] 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
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:
16098
diff
changeset

217 
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:
16098
diff
changeset

218 
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:
16098
diff
changeset

219 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

220 
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:
16098
diff
changeset

221 

27413  222 
lemma contlub_cfun_arg: "chain Y \<Longrightarrow> f\<cdot>(\<Squnion>i. Y i) = (\<Squnion>i. f\<cdot>(Y i))" 
35914  223 
by (rule cont_Rep_CFun2 [THEN cont2contlubE]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

224 

27413  225 
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:
16098
diff
changeset

226 
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:
16098
diff
changeset

227 

27413  228 
lemma contlub_cfun_fun: "chain F \<Longrightarrow> (\<Squnion>i. F i)\<cdot>x = (\<Squnion>i. F i\<cdot>x)" 
35914  229 
by (rule cont_Rep_CFun1 [THEN cont2contlubE]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

230 

27413  231 
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:
16098
diff
changeset

232 
by (rule cont_Rep_CFun1 [THEN contE]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

233 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

234 
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:
16098
diff
changeset

235 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

236 
lemma monofun_cfun_fun: "f \<sqsubseteq> g \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>x" 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

237 
by (simp add: expand_cfun_below) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

238 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

239 
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:
16098
diff
changeset

240 
by (rule monofun_Rep_CFun2 [THEN monofunE]) 
15576
efb95d0d01f7
converted to newstyle 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:
16098
diff
changeset

242 
lemma monofun_cfun: "\<lbrakk>f \<sqsubseteq> g; x \<sqsubseteq> y\<rbrakk> \<Longrightarrow> f\<cdot>x \<sqsubseteq> g\<cdot>y" 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

243 
by (rule below_trans [OF monofun_cfun_fun monofun_cfun_arg]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

244 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

245 
text {* ch2ch  rules for the type @{typ "'a > 'b"} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

246 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

247 
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:
16098
diff
changeset

248 
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:
16098
diff
changeset

249 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

250 
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:
16098
diff
changeset

251 
by (rule monofun_Rep_CFun2 [THEN ch2ch_monofun]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

252 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

253 
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:
16098
diff
changeset

254 
by (rule monofun_Rep_CFun1 [THEN ch2ch_monofun]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

255 

18076  256 
lemma ch2ch_Rep_CFun [simp]: 
257 
"\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> chain (\<lambda>i. (F i)\<cdot>(Y i))" 

25884  258 
by (simp add: chain_def monofun_cfun) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

259 

25884  260 
lemma ch2ch_LAM [simp]: 
261 
"\<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)" 

31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

262 
by (simp add: chain_def expand_cfun_below) 
18092
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

263 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

264 
text {* contlub, cont properties of @{term Rep_CFun} in both arguments *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

265 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

266 
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:
16098
diff
changeset

267 
"\<lbrakk>chain F; chain Y\<rbrakk> \<Longrightarrow> (\<Squnion>i. F i)\<cdot>(\<Squnion>i. Y i) = (\<Squnion>i. F i\<cdot>(Y i))" 
18076  268 
by (simp add: contlub_cfun_fun contlub_cfun_arg diag_lub) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

269 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

270 
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:
16098
diff
changeset

271 
"\<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:
16098
diff
changeset

272 
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:
16098
diff
changeset

273 
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:
16098
diff
changeset

274 
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:
16098
diff
changeset

275 
done 
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

276 

18092
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

277 
lemma contlub_LAM: 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

278 
"\<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:
18091
diff
changeset

279 
\<Longrightarrow> (\<Lambda> x. \<Squnion>i. F i x) = (\<Squnion>i. \<Lambda> x. F i x)" 
25884  280 
apply (simp add: thelub_CFun) 
18092
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

281 
apply (simp add: Abs_CFun_inverse2) 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

282 
apply (simp add: thelub_fun ch2ch_lambda) 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

283 
done 
2c5d5da79a1e
renamed and added ch2ch, cont2cont, mono2mono theorems ending in _fun, _lambda, _LAM
huffman
parents:
18091
diff
changeset

284 

25901  285 
lemmas lub_distribs = 
286 
contlub_cfun [symmetric] 

287 
contlub_LAM [symmetric] 

288 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

289 
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:
16098
diff
changeset

290 

36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

291 
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:
16098
diff
changeset

292 
apply (rule UU_I) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

293 
apply (erule subst) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

294 
apply (rule minimal [THEN monofun_cfun_arg]) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

295 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

296 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

297 
text {* the lub of a chain of continous functions is monotone *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

298 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

299 
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:
16098
diff
changeset

300 
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:
16098
diff
changeset

301 
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:
16098
diff
changeset

302 
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:
16098
diff
changeset

303 
apply (simp add: monofun_Rep_CFun2) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

304 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

305 

16386  306 
text {* a lemma about the exchange of lubs for type @{typ "'a > 'b"} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

307 

16699  308 
lemma ex_lub_cfun: 
309 
"\<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  310 
by (simp add: diag_lub) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

311 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

312 
text {* the lub of a chain of cont. functions is continuous *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

313 

16209
36ee7f6af79f
removed dependencies on MF2 lemmas; removed some obsolete theorems; cleaned up many proofs; renamed less_cfun2 to less_cfun_ext
huffman
parents:
16098
diff
changeset

314 
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:
16098
diff
changeset

315 
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:
16098
diff
changeset

316 
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:
16098
diff
changeset

317 
apply (rule cont_Rep_CFun2) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

318 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

319 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

320 
text {* type @{typ "'a > 'b"} is chain complete *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

321 

16920  322 
lemma lub_cfun: "chain F \<Longrightarrow> range F << (\<Lambda> x. \<Squnion>i. F i\<cdot>x)" 
323 
by (simp only: contlub_cfun_fun [symmetric] eta_cfun thelubE) 

15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

324 

27413  325 
lemma thelub_cfun: "chain F \<Longrightarrow> (\<Squnion>i. F i) = (\<Lambda> x. \<Squnion>i. F i\<cdot>x)" 
16920  326 
by (rule lub_cfun [THEN thelubI]) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

327 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

328 
subsection {* Continuity simplification procedure *} 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

329 

69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

330 
text {* cont2cont lemma for @{term Rep_CFun} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

331 

37079
0cd15d8c90a0
remove cont2cont simproc; instead declare cont2cont rules as simp rules
huffman
parents:
36452
diff
changeset

332 
lemma cont2cont_Rep_CFun [simp, cont2cont]: 
29049  333 
assumes f: "cont (\<lambda>x. f x)" 
334 
assumes t: "cont (\<lambda>x. t x)" 

335 
shows "cont (\<lambda>x. (f x)\<cdot>(t x))" 

336 
proof  

337 
have "cont (\<lambda>x. Rep_CFun (f x))" 

338 
using cont_Rep_CFun f by (rule cont2cont_app3) 

339 
thus "cont (\<lambda>x. (f x)\<cdot>(t x))" 

340 
using cont_Rep_CFun2 t by (rule cont2cont_app2) 

341 
qed 

15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

342 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

343 
text {* cont2mono Lemma for @{term "%x. LAM y. c1(x)(y)"} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

344 

efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

345 
lemma cont2mono_LAM: 
29049  346 
"\<lbrakk>\<And>x. cont (\<lambda>y. f x y); \<And>y. monofun (\<lambda>x. f x y)\<rbrakk> 
347 
\<Longrightarrow> monofun (\<lambda>x. \<Lambda> y. f x y)" 

31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

348 
unfolding monofun_def expand_cfun_below by simp 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

349 

29049  350 
text {* cont2cont Lemma for @{term "%x. LAM y. f x y"} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

351 

29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

352 
text {* 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

353 
Not suitable as a cont2cont rule, because on nested lambdas 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

354 
it causes exponential blowup in the number of subgoals. 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

355 
*} 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

356 

15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

357 
lemma cont2cont_LAM: 
29049  358 
assumes f1: "\<And>x. cont (\<lambda>y. f x y)" 
359 
assumes f2: "\<And>y. cont (\<lambda>x. f x y)" 

360 
shows "cont (\<lambda>x. \<Lambda> y. f x y)" 

361 
proof (rule cont_Abs_CFun) 

362 
fix x 

363 
from f1 show "f x \<in> CFun" by (simp add: CFun_def) 

364 
from f2 show "cont f" by (rule cont2cont_lambda) 

365 
qed 

15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

366 

29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

367 
text {* 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

368 
This version does work as a cont2cont rule, since it 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

369 
has only a single subgoal. 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

370 
*} 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

371 

37079
0cd15d8c90a0
remove cont2cont simproc; instead declare cont2cont rules as simp rules
huffman
parents:
36452
diff
changeset

372 
lemma cont2cont_LAM' [simp, cont2cont]: 
29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

373 
fixes f :: "'a::cpo \<Rightarrow> 'b::cpo \<Rightarrow> 'c::cpo" 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

374 
assumes f: "cont (\<lambda>p. f (fst p) (snd p))" 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

375 
shows "cont (\<lambda>x. \<Lambda> y. f x y)" 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

376 
proof (rule cont2cont_LAM) 
31041
85b4843d9939
replace cont2cont_apply with cont_apply; add new cont2cont lemmas
huffman
parents:
29533
diff
changeset

377 
fix x :: 'a show "cont (\<lambda>y. f x y)" 
85b4843d9939
replace cont2cont_apply with cont_apply; add new cont2cont lemmas
huffman
parents:
29533
diff
changeset

378 
using f by (rule cont_fst_snd_D2) 
29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

379 
next 
31041
85b4843d9939
replace cont2cont_apply with cont_apply; add new cont2cont lemmas
huffman
parents:
29533
diff
changeset

380 
fix y :: 'b show "cont (\<lambda>x. f x y)" 
85b4843d9939
replace cont2cont_apply with cont_apply; add new cont2cont lemmas
huffman
parents:
29533
diff
changeset

381 
using f by (rule cont_fst_snd_D1) 
29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

382 
qed 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

383 

37079
0cd15d8c90a0
remove cont2cont simproc; instead declare cont2cont rules as simp rules
huffman
parents:
36452
diff
changeset

384 
lemma cont2cont_LAM_discrete [simp, cont2cont]: 
29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

385 
"(\<And>y::'a::discrete_cpo. cont (\<lambda>x. f x y)) \<Longrightarrow> cont (\<lambda>x. \<Lambda> y. f x y)" 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

386 
by (simp add: cont2cont_LAM) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

387 

16055  388 
lemmas cont_lemmas1 = 
389 
cont_const cont_id cont_Rep_CFun2 cont2cont_Rep_CFun cont2cont_LAM 

390 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

391 
subsection {* Miscellaneous *} 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

392 

e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

393 
text {* Monotonicity of @{term Abs_CFun} *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

394 

17832
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

395 
lemma semi_monofun_Abs_CFun: 
e18fc1a9a0e0
rearranged subsections; added theorems expand_cfun_eq, expand_cfun_less
huffman
parents:
17817
diff
changeset

396 
"\<lbrakk>cont f; cont g; f \<sqsubseteq> g\<rbrakk> \<Longrightarrow> Abs_CFun f \<sqsubseteq> Abs_CFun g" 
31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

397 
by (simp add: below_CFun_def Abs_CFun_inverse2) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

398 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

399 
text {* some lemmata for functions with flat/chfin domain/range types *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

400 

efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

401 
lemma chfin_Rep_CFunR: "chain (Y::nat => 'a::cpo>'b::chfin) 
27413  402 
==> !s. ? n. (LUB i. Y i)$s = Y n$s" 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

403 
apply (rule allI) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

404 
apply (subst contlub_cfun_fun) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

405 
apply assumption 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

406 
apply (fast intro!: thelubI chfin lub_finch2 chfin2finch ch2ch_Rep_CFunL) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

407 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

408 

18089  409 
lemma adm_chfindom: "adm (\<lambda>(u::'a::cpo \<rightarrow> 'b::chfin). P(u\<cdot>s))" 
410 
by (rule adm_subst, simp, rule adm_chfin) 

411 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

412 
subsection {* Continuous injectionretraction pairs *} 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

413 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

414 
text {* Continuous retractions are strict. *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

415 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

416 
lemma retraction_strict: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

417 
"\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> f\<cdot>\<bottom> = \<bottom>" 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

418 
apply (rule UU_I) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

419 
apply (drule_tac x="\<bottom>" in spec) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

420 
apply (erule subst) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

421 
apply (rule monofun_cfun_arg) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

422 
apply (rule minimal) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

423 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

424 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

425 
lemma injection_eq: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

426 
"\<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:
16070
diff
changeset

427 
apply (rule iffI) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

428 
apply (drule_tac f=f in cfun_arg_cong) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

429 
apply simp 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

430 
apply simp 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

431 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

432 

31076
99fe356cbbc2
rename constant sq_le to below; rename class sq_ord to below; less>below in many lemma names
huffman
parents:
31041
diff
changeset

433 
lemma injection_below: 
16314  434 
"\<forall>x. f\<cdot>(g\<cdot>x) = x \<Longrightarrow> (g\<cdot>x \<sqsubseteq> g\<cdot>y) = (x \<sqsubseteq> y)" 
435 
apply (rule iffI) 

436 
apply (drule_tac f=f in monofun_cfun_arg) 

437 
apply simp 

438 
apply (erule monofun_cfun_arg) 

439 
done 

440 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

441 
lemma injection_defined_rev: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

442 
"\<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:
16070
diff
changeset

443 
apply (drule_tac f=f in cfun_arg_cong) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

444 
apply (simp add: retraction_strict) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

445 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

446 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

447 
lemma injection_defined: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

448 
"\<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:
16070
diff
changeset

449 
by (erule contrapos_nn, rule injection_defined_rev) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

450 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

451 
text {* propagation of flatness and chainfiniteness by retractions *} 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

452 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

453 
lemma chfin2chfin: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

454 
"\<forall>y. (f::'a::chfin \<rightarrow> 'b)\<cdot>(g\<cdot>y) = y 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

455 
\<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:
16070
diff
changeset

456 
apply clarify 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

457 
apply (drule_tac f=g in chain_monofun) 
25921  458 
apply (drule chfin) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

459 
apply (unfold max_in_chain_def) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

460 
apply (simp add: injection_eq) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

461 
done 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

462 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

463 
lemma flat2flat: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

464 
"\<forall>y. (f::'a::flat \<rightarrow> 'b::pcpo)\<cdot>(g\<cdot>y) = y 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

465 
\<Longrightarrow> \<forall>x y::'b. x \<sqsubseteq> y \<longrightarrow> x = \<bottom> \<or> x = y" 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

466 
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:
16098
diff
changeset

467 
apply (drule_tac f=g in monofun_cfun_arg) 
25920  468 
apply (drule ax_flat) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

469 
apply (erule disjE) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

470 
apply (simp add: injection_defined_rev) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

471 
apply (simp add: injection_eq) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

472 
done 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

473 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

474 
text {* a result about functions with flat codomain *} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

475 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

476 
lemma flat_eqI: "\<lbrakk>(x::'a::flat) \<sqsubseteq> y; x \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> x = y" 
25920  477 
by (drule ax_flat, simp) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

478 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

479 
lemma flat_codom: 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

480 
"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:
16070
diff
changeset

481 
apply (case_tac "f\<cdot>x = \<bottom>") 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

482 
apply (rule disjI1) 
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

483 
apply (rule UU_I) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

484 
apply (erule_tac t="\<bottom>" in subst) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

485 
apply (rule minimal [THEN monofun_cfun_arg]) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

486 
apply clarify 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

487 
apply (rule_tac a = "f\<cdot>\<bottom>" in refl [THEN box_equals]) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

488 
apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI]) 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

489 
apply (erule minimal [THEN monofun_cfun_arg, THEN flat_eqI]) 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

490 
done 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

491 

69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

492 

69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

493 
subsection {* Identity and composition *} 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

494 

25135
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

495 
definition 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

496 
ID :: "'a \<rightarrow> 'a" where 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

497 
"ID = (\<Lambda> x. x)" 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

498 

4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

499 
definition 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

500 
cfcomp :: "('b \<rightarrow> 'c) \<rightarrow> ('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'c" where 
4f8176c940cf
modernized specifications ('definition', 'axiomatization');
wenzelm
parents:
25131
diff
changeset

501 
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:
15577
diff
changeset

502 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

503 
abbreviation 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

504 
cfcomp_syn :: "['b \<rightarrow> 'c, 'a \<rightarrow> 'b] \<Rightarrow> 'a \<rightarrow> 'c" (infixr "oo" 100) where 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

505 
"f oo g == cfcomp\<cdot>f\<cdot>g" 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

506 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

507 
lemma ID1 [simp]: "ID\<cdot>x = x" 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

508 
by (simp add: ID_def) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

509 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

510 
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:
15577
diff
changeset

511 
by (simp add: oo_def) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

512 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

513 
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:
15577
diff
changeset

514 
by (simp add: cfcomp1) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

515 

27274  516 
lemma cfcomp_LAM: "cont g \<Longrightarrow> f oo (\<Lambda> x. g x) = (\<Lambda> x. f\<cdot>(g x))" 
517 
by (simp add: cfcomp1) 

518 

19709  519 
lemma cfcomp_strict [simp]: "\<bottom> oo f = \<bottom>" 
520 
by (simp add: expand_cfun_eq) 

521 

15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

522 
text {* 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

523 
Show that interpretation of (pcpo,@{text "_>_"}) is a category. 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

524 
The class of objects is interpretation of syntactical class pcpo. 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

525 
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:
15577
diff
changeset

526 
The identity arrow is interpretation of @{term ID}. 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

527 
The composition of f and g is interpretation of @{text "oo"}. 
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

528 
*} 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

529 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

530 
lemma ID2 [simp]: "f oo ID = f" 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

531 
by (rule ext_cfun, simp) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

532 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

533 
lemma ID3 [simp]: "ID oo f = f" 
15589
69bea57212ef
reordered and arranged for document generation, cleaned up some proofs
huffman
parents:
15577
diff
changeset

534 
by (rule ext_cfun, simp) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

535 

efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

536 
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:
15577
diff
changeset

537 
by (rule ext_cfun, simp) 
15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

538 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

539 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

540 
subsection {* Strictified functions *} 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

541 

36452  542 
default_sort pcpo 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

543 

25131
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

544 
definition 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

545 
strictify :: "('a \<rightarrow> 'b) \<rightarrow> 'a \<rightarrow> 'b" where 
2c8caac48ade
modernized specifications ('definition', 'abbreviation', 'notation');
wenzelm
parents:
23152
diff
changeset

546 
"strictify = (\<Lambda> f x. if x = \<bottom> then \<bottom> else f\<cdot>x)" 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

547 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

548 
text {* results about strictify *} 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

549 

17815  550 
lemma cont_strictify1: "cont (\<lambda>f. if x = \<bottom> then \<bottom> else f\<cdot>x)" 
35168  551 
by simp 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

552 

17815  553 
lemma monofun_strictify2: "monofun (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)" 
554 
apply (rule monofunI) 

25786  555 
apply (auto simp add: monofun_cfun_arg) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

556 
done 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

557 

35914  558 
lemma cont_strictify2: "cont (\<lambda>x. if x = \<bottom> then \<bottom> else f\<cdot>x)" 
559 
apply (rule contI2) 

560 
apply (rule monofun_strictify2) 

561 
apply (case_tac "(\<Squnion>i. Y i) = \<bottom>", simp) 

562 
apply (simp add: contlub_cfun_arg del: if_image_distrib) 

563 
apply (drule chain_UU_I_inverse2, clarify, rename_tac j) 

564 
apply (rule lub_mono2, rule_tac x=j in exI, simp_all) 

565 
apply (auto dest!: chain_mono_less) 

16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

566 
done 
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

567 

17815  568 
lemma strictify_conv_if: "strictify\<cdot>f\<cdot>x = (if x = \<bottom> then \<bottom> else f\<cdot>x)" 
29530
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

569 
unfolding strictify_def 
9905b660612b
change to simpler, more extensible continuity simproc
huffman
parents:
29138
diff
changeset

570 
by (simp add: cont_strictify1 cont_strictify2 cont2cont_LAM) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

571 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

572 
lemma strictify1 [simp]: "strictify\<cdot>f\<cdot>\<bottom> = \<bottom>" 
17815  573 
by (simp add: strictify_conv_if) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

574 

c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

575 
lemma strictify2 [simp]: "x \<noteq> \<bottom> \<Longrightarrow> strictify\<cdot>f\<cdot>x = f\<cdot>x" 
17815  576 
by (simp add: strictify_conv_if) 
16085
c004b9bc970e
rewrote continuous isomorphism section, cleaned up
huffman
parents:
16070
diff
changeset

577 

35933
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

578 
subsection {* Continuity of letbindings *} 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

579 

35933
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

580 
lemma cont2cont_Let: 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

581 
assumes f: "cont (\<lambda>x. f x)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

582 
assumes g1: "\<And>y. cont (\<lambda>x. g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

583 
assumes g2: "\<And>x. cont (\<lambda>y. g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

584 
shows "cont (\<lambda>x. let y = f x in g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

585 
unfolding Let_def using f g2 g1 by (rule cont_apply) 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

586 

37079
0cd15d8c90a0
remove cont2cont simproc; instead declare cont2cont rules as simp rules
huffman
parents:
36452
diff
changeset

587 
lemma cont2cont_Let' [simp, cont2cont]: 
35933
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

588 
assumes f: "cont (\<lambda>x. f x)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

589 
assumes g: "cont (\<lambda>p. g (fst p) (snd p))" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

590 
shows "cont (\<lambda>x. let y = f x in g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

591 
using f 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

592 
proof (rule cont2cont_Let) 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

593 
fix x show "cont (\<lambda>y. g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

594 
using g by (rule cont_fst_snd_D2) 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

595 
next 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

596 
fix y show "cont (\<lambda>x. g x y)" 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

597 
using g by (rule cont_fst_snd_D1) 
f135ebcc835c
remove continuous letbinding function CLet; add cont2cont rule ordinary Let
huffman
parents:
35914
diff
changeset

598 
qed 
17816
9942c5ed866a
new syntax translations for continuous lambda abstraction
huffman
parents:
17815
diff
changeset

599 

15576
efb95d0d01f7
converted to newstyle theories, and combined numbered files
huffman
parents:
diff
changeset

600 
end 