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