| author | paulson | 
| Tue, 06 Jan 2004 10:50:36 +0100 | |
| changeset 14342 | 6e564092d72d | 
| parent 12030 | 46d57d0290a2 | 
| child 14981 | e73f8140af78 | 
| permissions | -rw-r--r-- | 
| 2640 | 1 | (* Title: HOLCF/Cont.ML | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 2 | ID: $Id$ | 
| 1461 | 3 | Author: Franz Regensburger | 
| 12030 | 4 | License: GPL (GNU GENERAL PUBLIC LICENSE) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 5 | |
| 8935 
548901d05a0e
added type constraint ::nat because 0 is now overloaded
 paulson parents: 
7499diff
changeset | 6 | Results about continuity and monotonicity | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 7 | *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 8 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 9 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 10 | (* access to definition *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 11 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 12 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 13 | Goalw [contlub] | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 14 | "! Y. chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))==>\ | 
| 9245 | 15 | \ contlub(f)"; | 
| 16 | by (atac 1); | |
| 17 | qed "contlubI"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 18 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 19 | Goalw [contlub] | 
| 1461 | 20 | " contlub(f)==>\ | 
| 9245 | 21 | \ ! Y. chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))"; | 
| 22 | by (atac 1); | |
| 23 | qed "contlubE"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 24 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 25 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 26 | Goalw [cont] | 
| 9245 | 27 | "! Y. chain(Y) --> range(% i. f(Y(i))) <<| f(lub(range(Y))) ==> cont(f)"; | 
| 28 | by (atac 1); | |
| 29 | qed "contI"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 30 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 31 | Goalw [cont] | 
| 9245 | 32 | "cont(f) ==> ! Y. chain(Y) --> range(% i. f(Y(i))) <<| f(lub(range(Y)))"; | 
| 33 | by (atac 1); | |
| 34 | qed "contE"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 35 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 36 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 37 | Goalw [monofun] | 
| 9245 | 38 | "! x y. x << y --> f(x) << f(y) ==> monofun(f)"; | 
| 39 | by (atac 1); | |
| 40 | qed "monofunI"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 41 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 42 | Goalw [monofun] | 
| 9245 | 43 | "monofun(f) ==> ! x y. x << y --> f(x) << f(y)"; | 
| 44 | by (atac 1); | |
| 45 | qed "monofunE"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 46 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 47 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 48 | (* the main purpose of cont.thy is to show: *) | 
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 49 | (* monofun(f) & contlub(f) <==> cont(f) *) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 50 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 51 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 52 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 53 | (* monotone functions map chains to chains *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 54 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 55 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 56 | Goal | 
| 9245 | 57 | "[| monofun(f); chain(Y) |] ==> chain(%i. f(Y(i)))"; | 
| 58 | by (rtac chainI 1); | |
| 59 | by (etac (monofunE RS spec RS spec RS mp) 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 60 | by (etac (chainE) 1); | 
| 9245 | 61 | qed "ch2ch_monofun"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 62 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 63 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 64 | (* monotone functions map upper bound to upper bounds *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 65 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 66 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 67 | Goal | 
| 9245 | 68 | "[| monofun(f); range(Y) <| u|] ==> range(%i. f(Y(i))) <| f(u)"; | 
| 69 | by (rtac ub_rangeI 1); | |
| 70 | by (etac (monofunE RS spec RS spec RS mp) 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 71 | by (etac (ub_rangeD) 1); | 
| 9245 | 72 | qed "ub2ub_monofun"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 73 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 74 | (* ------------------------------------------------------------------------ *) | 
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 75 | (* left to right: monofun(f) & contlub(f) ==> cont(f) *) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 76 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 77 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 78 | Goalw [cont] | 
| 9245 | 79 | "[|monofun(f);contlub(f)|] ==> cont(f)"; | 
| 80 | by (strip_tac 1); | |
| 81 | by (rtac thelubE 1); | |
| 82 | by (etac ch2ch_monofun 1); | |
| 83 | by (atac 1); | |
| 84 | by (etac (contlubE RS spec RS mp RS sym) 1); | |
| 85 | by (atac 1); | |
| 86 | qed "monocontlub2cont"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 87 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 88 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 89 | (* first a lemma about binary chains *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 90 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 91 | |
| 9245 | 92 | Goal "[| cont(f); x << y |] \ | 
| 93 | \ ==> range(%i::nat. f(if i = 0 then x else y)) <<| f(y)"; | |
| 94 | by (rtac subst 1); | |
| 95 | by (etac (contE RS spec RS mp) 2); | |
| 96 | by (etac bin_chain 2); | |
| 97 | by (res_inst_tac [("y","y")] arg_cong 1);
 | |
| 98 | by (etac (lub_bin_chain RS thelubI) 1); | |
| 99 | qed "binchain_cont"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 100 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 101 | (* ------------------------------------------------------------------------ *) | 
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 102 | (* right to left: cont(f) ==> monofun(f) & contlub(f) *) | 
| 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 103 | (* part1: cont(f) ==> monofun(f *) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 104 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 105 | |
| 9245 | 106 | Goalw [monofun] "cont(f) ==> monofun(f)"; | 
| 107 | by (strip_tac 1); | |
| 108 | by (dtac (binchain_cont RS is_ub_lub) 1); | |
| 109 | by (auto_tac (claset(), simpset() addsplits [split_if_asm])); | |
| 110 | qed "cont2mono"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 111 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 112 | (* ------------------------------------------------------------------------ *) | 
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 113 | (* right to left: cont(f) ==> monofun(f) & contlub(f) *) | 
| 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 114 | (* part2: cont(f) ==> contlub(f) *) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 115 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 116 | |
| 9245 | 117 | Goalw [contlub] "cont(f) ==> contlub(f)"; | 
| 118 | by (strip_tac 1); | |
| 119 | by (rtac (thelubI RS sym) 1); | |
| 120 | by (etac (contE RS spec RS mp) 1); | |
| 121 | by (atac 1); | |
| 122 | qed "cont2contlub"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 123 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 124 | (* ------------------------------------------------------------------------ *) | 
| 9245 | 125 | (* monotone functions map finite chains to finite chains *) | 
| 2354 | 126 | (* ------------------------------------------------------------------------ *) | 
| 127 | ||
| 9245 | 128 | Goalw [finite_chain_def] | 
| 129 | "[| monofun f; finite_chain Y |] ==> finite_chain (%n. f (Y n))"; | |
| 130 | by (force_tac (claset() addSEs [ch2ch_monofun], | |
| 131 | simpset() addsimps [max_in_chain_def]) 1); | |
| 132 | qed "monofun_finch2finch"; | |
| 2354 | 133 | |
| 134 | (* ------------------------------------------------------------------------ *) | |
| 9245 | 135 | (* The same holds for continuous functions *) | 
| 2354 | 136 | (* ------------------------------------------------------------------------ *) | 
| 137 | ||
| 138 | bind_thm ("cont_finch2finch", cont2mono RS monofun_finch2finch);
 | |
| 139 | (* [| cont ?f; finite_chain ?Y |] ==> finite_chain (%n. ?f (?Y n)) *) | |
| 140 | ||
| 141 | ||
| 142 | (* ------------------------------------------------------------------------ *) | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 143 | (* The following results are about a curried function that is monotone *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 144 | (* in both arguments *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 145 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 146 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 147 | Goal | 
| 9245 | 148 | "[|monofun(MF2); chain(F)|] ==> chain(%i. MF2 (F i) x)"; | 
| 149 | by (etac (ch2ch_monofun RS ch2ch_fun) 1); | |
| 150 | by (atac 1); | |
| 151 | qed "ch2ch_MF2L"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 152 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 153 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 154 | Goal | 
| 9245 | 155 | "[|monofun(MF2(f)); chain(Y)|] ==> chain(%i. MF2 f (Y i))"; | 
| 156 | by (etac ch2ch_monofun 1); | |
| 157 | by (atac 1); | |
| 158 | qed "ch2ch_MF2R"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 159 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 160 | Goal | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 161 | "[|monofun(MF2); !f. monofun(MF2(f)); chain(F); chain(Y)|] ==> \ | 
| 9245 | 162 | \ chain(%i. MF2(F(i))(Y(i)))"; | 
| 163 | by (rtac chainI 1); | |
| 164 | by (rtac trans_less 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 165 | by (etac (ch2ch_MF2L RS chainE) 1); | 
| 9245 | 166 | by (atac 1); | 
| 167 | by ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 168 | by (etac (chainE) 1); | 
| 9245 | 169 | qed "ch2ch_MF2LR"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 170 | |
| 752 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 171 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 172 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 173 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 174 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 175 | \ chain(F);chain(Y)|] ==> \ | 
| 9245 | 176 | \ chain(%j. lub(range(%i. MF2 (F j) (Y i))))"; | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 177 | by (rtac (lub_mono RS chainI) 1); | 
| 9245 | 178 | by ((rtac ch2ch_MF2R 1) THEN (etac spec 1)); | 
| 179 | by (atac 1); | |
| 180 | by ((rtac ch2ch_MF2R 1) THEN (etac spec 1)); | |
| 181 | by (atac 1); | |
| 182 | by (strip_tac 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 183 | by (rtac (chainE) 1); | 
| 9245 | 184 | by (etac ch2ch_MF2L 1); | 
| 185 | by (atac 1); | |
| 186 | qed "ch2ch_lubMF2R"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 187 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 188 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 189 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 190 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 191 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 192 | \ chain(F);chain(Y)|] ==> \ | 
| 9245 | 193 | \ chain(%i. lub(range(%j. MF2 (F j) (Y i))))"; | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 194 | by (rtac (lub_mono RS chainI) 1); | 
| 9245 | 195 | by (etac ch2ch_MF2L 1); | 
| 196 | by (atac 1); | |
| 197 | by (etac ch2ch_MF2L 1); | |
| 198 | by (atac 1); | |
| 199 | by (strip_tac 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 200 | by (rtac (chainE) 1); | 
| 9245 | 201 | by ((rtac ch2ch_MF2R 1) THEN (etac spec 1)); | 
| 202 | by (atac 1); | |
| 203 | qed "ch2ch_lubMF2L"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 204 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 205 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 206 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 207 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 208 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 209 | \ chain(F)|] ==> \ | 
| 9245 | 210 | \ monofun(% x. lub(range(% j. MF2 (F j) (x))))"; | 
| 211 | by (rtac monofunI 1); | |
| 212 | by (strip_tac 1); | |
| 213 | by (rtac lub_mono 1); | |
| 214 | by (etac ch2ch_MF2L 1); | |
| 215 | by (atac 1); | |
| 216 | by (etac ch2ch_MF2L 1); | |
| 217 | by (atac 1); | |
| 218 | by (strip_tac 1); | |
| 219 | by ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)); | |
| 220 | by (atac 1); | |
| 221 | qed "lub_MF2_mono"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 222 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 223 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 224 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 225 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 226 | \ chain(F); chain(Y)|] ==> \ | 
| 1461 | 227 | \ lub(range(%j. lub(range(%i. MF2(F j) (Y i))))) =\ | 
| 9245 | 228 | \ lub(range(%i. lub(range(%j. MF2(F j) (Y i)))))"; | 
| 229 | by (rtac antisym_less 1); | |
| 230 | by (rtac (ub_rangeI RSN (2,is_lub_thelub)) 1); | |
| 231 | by (etac ch2ch_lubMF2R 1); | |
| 232 | by (REPEAT (atac 1)); | |
| 233 | by (strip_tac 1); | |
| 234 | by (rtac lub_mono 1); | |
| 235 | by ((rtac ch2ch_MF2R 1) THEN (etac spec 1)); | |
| 236 | by (atac 1); | |
| 237 | by (etac ch2ch_lubMF2L 1); | |
| 238 | by (REPEAT (atac 1)); | |
| 239 | by (strip_tac 1); | |
| 240 | by (rtac is_ub_thelub 1); | |
| 241 | by (etac ch2ch_MF2L 1); | |
| 242 | by (atac 1); | |
| 243 | by (rtac (ub_rangeI RSN (2,is_lub_thelub)) 1); | |
| 244 | by (etac ch2ch_lubMF2L 1); | |
| 245 | by (REPEAT (atac 1)); | |
| 246 | by (strip_tac 1); | |
| 247 | by (rtac lub_mono 1); | |
| 248 | by (etac ch2ch_MF2L 1); | |
| 249 | by (atac 1); | |
| 250 | by (etac ch2ch_lubMF2R 1); | |
| 251 | by (REPEAT (atac 1)); | |
| 252 | by (strip_tac 1); | |
| 253 | by (rtac is_ub_thelub 1); | |
| 254 | by ((rtac ch2ch_MF2R 1) THEN (etac spec 1)); | |
| 255 | by (atac 1); | |
| 256 | qed "ex_lubMF2"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 257 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 258 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 259 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 260 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 261 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 262 | \ chain(FY);chain(TY)|] ==>\ | 
| 752 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 263 | \ lub(range(%i. lub(range(%j. MF2(FY(j))(TY(i)))))) =\ | 
| 9245 | 264 | \ lub(range(%i. MF2(FY(i))(TY(i))))"; | 
| 265 | by (rtac antisym_less 1); | |
| 266 | by (rtac (ub_rangeI RSN (2,is_lub_thelub)) 1); | |
| 267 | by (etac ch2ch_lubMF2L 1); | |
| 268 | by (REPEAT (atac 1)); | |
| 269 | by (strip_tac 1 ); | |
| 270 | by (rtac lub_mono3 1); | |
| 271 | by (etac ch2ch_MF2L 1); | |
| 272 | by (REPEAT (atac 1)); | |
| 273 | by (etac ch2ch_MF2LR 1); | |
| 274 | by (REPEAT (atac 1)); | |
| 275 | by (rtac allI 1); | |
| 276 | by (res_inst_tac [("m","i"),("n","ia")] nat_less_cases 1);
 | |
| 277 | by (res_inst_tac [("x","ia")] exI 1);
 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 278 | by (rtac (chain_mono) 1); | 
| 9245 | 279 | by (etac allE 1); | 
| 280 | by (etac ch2ch_MF2R 1); | |
| 281 | by (REPEAT (atac 1)); | |
| 282 | by (hyp_subst_tac 1); | |
| 283 | by (res_inst_tac [("x","ia")] exI 1);
 | |
| 284 | by (rtac refl_less 1); | |
| 285 | by (res_inst_tac [("x","i")] exI 1);
 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 286 | by (rtac (chain_mono) 1); | 
| 9245 | 287 | by (etac ch2ch_MF2L 1); | 
| 288 | by (REPEAT (atac 1)); | |
| 289 | by (rtac lub_mono 1); | |
| 290 | by (etac ch2ch_MF2LR 1); | |
| 291 | by (REPEAT(atac 1)); | |
| 292 | by (etac ch2ch_lubMF2L 1); | |
| 293 | by (REPEAT (atac 1)); | |
| 294 | by (strip_tac 1 ); | |
| 295 | by (rtac is_ub_thelub 1); | |
| 296 | by (etac ch2ch_MF2L 1); | |
| 297 | by (atac 1); | |
| 298 | qed "diag_lubMF2_1"; | |
| 625 | 299 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 300 | Goal | 
| 2838 
2e908f29bc3d
changed continuous functions from pcpo to cpo (including instances)
 slotosch parents: 
2640diff
changeset | 301 | "[|monofun(MF2::('a::po=>'b::po=>'c::cpo));\
 | 
| 3842 | 302 | \  !f. monofun(MF2(f)::('b::po=>'c::cpo));\
 | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 303 | \ chain(FY);chain(TY)|] ==>\ | 
| 752 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 304 | \ lub(range(%j. lub(range(%i. MF2(FY(j))(TY(i)))))) =\ | 
| 9245 | 305 | \ lub(range(%i. MF2(FY(i))(TY(i))))"; | 
| 306 | by (rtac trans 1); | |
| 307 | by (rtac ex_lubMF2 1); | |
| 308 | by (REPEAT (atac 1)); | |
| 309 | by (etac diag_lubMF2_1 1); | |
| 310 | by (REPEAT (atac 1)); | |
| 311 | qed "diag_lubMF2_2"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 312 | |
| 752 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 313 | |
| 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 314 | (* ------------------------------------------------------------------------ *) | 
| 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 315 | (* The following results are about a curried function that is continuous *) | 
| 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 316 | (* in both arguments *) | 
| 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 317 | (* ------------------------------------------------------------------------ *) | 
| 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 318 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 319 | val [prem1,prem2,prem3,prem4] = goal thy | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 320 | "[| cont(CF2); !f. cont(CF2(f)); chain(FY); chain(TY)|] ==>\ | 
| 9245 | 321 | \ CF2(lub(range(FY)))(lub(range(TY))) = lub(range(%i. CF2(FY(i))(TY(i))))"; | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 322 | by (cut_facts_tac [prem1,prem2,prem3, prem4] 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 323 | by (stac (prem1 RS cont2contlub RS contlubE RS spec RS mp) 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 324 | by (assume_tac 1); | 
| 9245 | 325 | by (stac thelub_fun 1); | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 326 | by (rtac (prem1 RS (cont2mono RS ch2ch_monofun)) 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 327 | by (assume_tac 1); | 
| 9245 | 328 | by (rtac trans 1); | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 329 | by (rtac ((prem2 RS spec RS cont2contlub) RS contlubE RS spec RS mp RS ext RS arg_cong RS arg_cong) 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 330 | by (rtac prem4 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 331 | by (blast_tac (claset() addIs [diag_lubMF2_2, cont2mono]) 1); | 
| 9245 | 332 | qed "contlub_CF2"; | 
| 752 
b89462f9d5f1
----------------------------------------------------------------------
 regensbu parents: 
625diff
changeset | 333 | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 334 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 335 | (* The following results are about application for functions in 'a=>'b *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 336 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 337 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 338 | Goal "f1 << f2 ==> f1(x) << f2(x)"; | 
| 9245 | 339 | by (etac (less_fun RS iffD1 RS spec) 1); | 
| 340 | qed "monofun_fun_fun"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 341 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 342 | Goal "[|monofun(f); x1 << x2|] ==> f(x1) << f(x2)"; | 
| 9245 | 343 | by (etac (monofunE RS spec RS spec RS mp) 1); | 
| 344 | by (atac 1); | |
| 345 | qed "monofun_fun_arg"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 346 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 347 | Goal "[|monofun(f1); monofun(f2); f1 << f2; x1 << x2|] ==> f1(x1) << f2(x2)"; | 
| 9245 | 348 | by (rtac trans_less 1); | 
| 349 | by (etac monofun_fun_arg 1); | |
| 350 | by (atac 1); | |
| 351 | by (etac monofun_fun_fun 1); | |
| 352 | qed "monofun_fun"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 353 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 354 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 355 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 356 | (* The following results are about the propagation of monotonicity and *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 357 | (* continuity *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 358 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 359 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 360 | Goal "[|monofun(c1)|] ==> monofun(%x. c1 x y)"; | 
| 9245 | 361 | by (rtac monofunI 1); | 
| 362 | by (strip_tac 1); | |
| 363 | by (etac (monofun_fun_arg RS monofun_fun_fun) 1); | |
| 364 | by (atac 1); | |
| 365 | qed "mono2mono_MF1L"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 366 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 367 | Goal "[|cont(c1)|] ==> cont(%x. c1 x y)"; | 
| 9245 | 368 | by (rtac monocontlub2cont 1); | 
| 369 | by (etac (cont2mono RS mono2mono_MF1L) 1); | |
| 370 | by (rtac contlubI 1); | |
| 371 | by (strip_tac 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 372 | by (ftac asm_rl 1); | 
| 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 373 | by (etac (cont2contlub RS contlubE RS spec RS mp RS ssubst) 1); | 
| 9245 | 374 | by (atac 1); | 
| 375 | by (stac thelub_fun 1); | |
| 376 | by (rtac ch2ch_monofun 1); | |
| 377 | by (etac cont2mono 1); | |
| 378 | by (atac 1); | |
| 379 | by (rtac refl 1); | |
| 380 | qed "cont2cont_CF1L"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 381 | |
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 382 | (********* Note "(%x.%y.c1 x y) = c1" ***********) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 383 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 384 | Goal "!y. monofun(%x. c1 x y) ==> monofun(c1)"; | 
| 9245 | 385 | by (rtac monofunI 1); | 
| 386 | by (strip_tac 1); | |
| 387 | by (rtac (less_fun RS iffD2) 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 388 | by (blast_tac (claset() addDs [monofunE]) 1); | 
| 9245 | 389 | qed "mono2mono_MF1L_rev"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 390 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 391 | Goal "!y. cont(%x. c1 x y) ==> cont(c1)"; | 
| 9245 | 392 | by (rtac monocontlub2cont 1); | 
| 393 | by (rtac (cont2mono RS allI RS mono2mono_MF1L_rev ) 1); | |
| 394 | by (etac spec 1); | |
| 395 | by (rtac contlubI 1); | |
| 396 | by (strip_tac 1); | |
| 397 | by (rtac ext 1); | |
| 398 | by (stac thelub_fun 1); | |
| 399 | by (rtac (cont2mono RS allI RS mono2mono_MF1L_rev RS ch2ch_monofun) 1); | |
| 400 | by (etac spec 1); | |
| 401 | by (atac 1); | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 402 | by (blast_tac (claset() addDs [ cont2contlub RS contlubE]) 1); | 
| 9245 | 403 | qed "cont2cont_CF1L_rev"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 404 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 405 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 406 | (* What D.A.Schmidt calls continuity of abstraction *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 407 | (* never used here *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 408 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 409 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 410 | Goal | 
| 4721 
c8a8482a8124
renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
 oheimb parents: 
4098diff
changeset | 411 | "[|chain(Y::nat=>'a);!y. cont(%x.(c::'a::cpo=>'b::cpo=>'c::cpo) x y)|] ==>\ | 
| 9245 | 412 | \ (%y. lub(range(%i. c (Y i) y))) = (lub(range(%i.%y. c (Y i) y)))"; | 
| 413 | by (rtac trans 1); | |
| 414 | by (rtac (cont2contlub RS contlubE RS spec RS mp) 2); | |
| 415 | by (atac 3); | |
| 416 | by (etac cont2cont_CF1L_rev 2); | |
| 417 | by (rtac ext 1); | |
| 418 | by (rtac (cont2contlub RS contlubE RS spec RS mp RS sym) 1); | |
| 419 | by (etac spec 1); | |
| 420 | by (atac 1); | |
| 421 | qed "contlub_abstraction"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 422 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 423 | Goal "[|monofun(ft);!x. monofun(ft(x));monofun(tt)|] ==>\ | 
| 9245 | 424 | \ monofun(%x.(ft(x))(tt(x)))"; | 
| 425 | by (rtac monofunI 1); | |
| 426 | by (strip_tac 1); | |
| 427 | by (res_inst_tac [("f1.0","ft(x)"),("f2.0","ft(y)")] monofun_fun 1);
 | |
| 428 | by (etac spec 1); | |
| 429 | by (etac spec 1); | |
| 430 | by (etac (monofunE RS spec RS spec RS mp) 1); | |
| 431 | by (atac 1); | |
| 432 | by (etac (monofunE RS spec RS spec RS mp) 1); | |
| 433 | by (atac 1); | |
| 434 | qed "mono2mono_app"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 435 | |
| 625 | 436 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 437 | Goal "[|cont(ft);!x. cont(ft(x));cont(tt)|] ==> contlub(%x.(ft(x))(tt(x)))"; | 
| 9245 | 438 | by (rtac contlubI 1); | 
| 439 | by (strip_tac 1); | |
| 440 | by (res_inst_tac [("f3","tt")] (contlubE RS spec RS mp RS ssubst) 1);
 | |
| 441 | by (etac cont2contlub 1); | |
| 442 | by (atac 1); | |
| 443 | by (rtac contlub_CF2 1); | |
| 444 | by (REPEAT (atac 1)); | |
| 445 | by (etac (cont2mono RS ch2ch_monofun) 1); | |
| 446 | by (atac 1); | |
| 447 | qed "cont2contlub_app"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 448 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 449 | |
| 9245 | 450 | Goal "[|cont(ft); !x. cont(ft(x)); cont(tt)|] ==> cont(%x.(ft(x))(tt(x)))"; | 
| 451 | by (blast_tac (claset() addIs [monocontlub2cont, mono2mono_app, cont2mono, | |
| 452 | cont2contlub_app]) 1); | |
| 453 | qed "cont2cont_app"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 454 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 455 | |
| 1779 | 456 | bind_thm ("cont2cont_app2", allI RSN (2,cont2cont_app));
 | 
| 1168 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 457 | (* [| cont ?ft; !!x. cont (?ft x); cont ?tt |] ==> *) | 
| 
74be52691d62
The curried version of HOLCF is now just called HOLCF. The old
 regensbu parents: 
892diff
changeset | 458 | (* cont (%x. ?ft x (?tt x)) *) | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 459 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 460 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 461 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 462 | (* The identity function is continuous *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 463 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 464 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 465 | Goal "cont(% x. x)"; | 
| 9245 | 466 | by (rtac contI 1); | 
| 467 | by (strip_tac 1); | |
| 468 | by (etac thelubE 1); | |
| 469 | by (rtac refl 1); | |
| 470 | qed "cont_id"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 471 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 472 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 473 | (* constant functions are continuous *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 474 | (* ------------------------------------------------------------------------ *) | 
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 475 | |
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 476 | Goalw [cont] "cont(%x. c)"; | 
| 9245 | 477 | by (strip_tac 1); | 
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 478 | by (blast_tac (claset() addIs [is_lubI, ub_rangeI] addDs [ub_rangeD]) 1); | 
| 9245 | 479 | qed "cont_const"; | 
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 480 | |
| 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 481 | |
| 9245 | 482 | Goal "[|cont(f); cont(t) |] ==> cont(%x. f(t(x)))"; | 
| 483 | by (best_tac (claset() addIs [ cont2cont_app2, cont_const]) 1); | |
| 484 | qed "cont2cont_app3"; | |
| 243 
c22b85994e17
Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
 nipkow parents: diff
changeset | 485 | |
| 2640 | 486 | (* ------------------------------------------------------------------------ *) | 
| 487 | (* A non-emptyness result for Cfun *) | |
| 488 | (* ------------------------------------------------------------------------ *) | |
| 489 | ||
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 490 | Goal "?x:Collect cont"; | 
| 9245 | 491 | by (rtac CollectI 1); | 
| 492 | by (rtac cont_const 1); | |
| 493 | qed "CfunI"; | |
| 3326 | 494 | |
| 495 | (* ------------------------------------------------------------------------ *) | |
| 9245 | 496 | (* some properties of flat *) | 
| 3326 | 497 | (* ------------------------------------------------------------------------ *) | 
| 498 | ||
| 9248 
e1dee89de037
massive tidy-up: goal -> Goal, remove use of prems, etc.
 paulson parents: 
9245diff
changeset | 499 | Goalw [monofun] "f UU = UU ==> monofun (f::'a::flat=>'b::pcpo)"; | 
| 9245 | 500 | by (strip_tac 1); | 
| 501 | by (dtac (ax_flat RS spec RS spec RS mp) 1); | |
| 502 | by (fast_tac ((HOL_cs addss (simpset() addsimps [minimal]))) 1); | |
| 503 | qed "flatdom2monofun"; | |
| 3326 | 504 | |
| 505 | ||
| 5297 | 506 | Goal "monofun f ==> cont(f::'a::chfin=>'b::pcpo)"; | 
| 7322 | 507 | by (rtac monocontlub2cont 1); | 
| 508 | by ( atac 1); | |
| 509 | by (rtac contlubI 1); | |
| 510 | by (strip_tac 1); | |
| 7499 | 511 | by (ftac chfin2finch 1); | 
| 7322 | 512 | by (rtac antisym_less 1); | 
| 513 | by ( force_tac (HOL_cs addIs [is_ub_thelub,ch2ch_monofun], | |
| 5297 | 514 | HOL_ss addsimps [finite_chain_def,maxinch_is_thelub]) 1); | 
| 7322 | 515 | by (dtac (monofun_finch2finch COMP swap_prems_rl) 1); | 
| 516 | by ( atac 1); | |
| 517 | by (asm_full_simp_tac (HOL_ss addsimps [finite_chain_def]) 1); | |
| 518 | by (etac conjE 1); | |
| 519 | by (etac exE 1); | |
| 520 | by (asm_full_simp_tac (HOL_ss addsimps [maxinch_is_thelub]) 1); | |
| 521 | by (etac (monofunE RS spec RS spec RS mp) 1); | |
| 522 | by (etac is_ub_thelub 1); | |
| 5297 | 523 | qed "chfindom_monofun2cont"; | 
| 3326 | 524 | |
| 525 | bind_thm ("flatdom_strict2cont",flatdom2monofun RS chfindom_monofun2cont);
 | |
| 526 | (* f UU = UU ==> cont (f::'a=>'b::pcpo)" *) |