src/HOLCF/Cont.ML
changeset 2640 ee4dfce170a0
parent 2354 b4a1e3306aa0
child 2838 2e908f29bc3d
equal deleted inserted replaced
2639:2c38796b33b9 2640:ee4dfce170a0
     1 (*  Title:      HOLCF/cont.ML
     1 (*  Title:      HOLCF/Cont.ML
     2     ID:         $Id$
     2     ID:         $Id$
     3     Author:     Franz Regensburger
     3     Author:     Franz Regensburger
     4     Copyright   1993 Technische Universitaet Muenchen
     4     Copyright   1993 Technische Universitaet Muenchen
     5 
     5 
     6 Lemmas for cont.thy 
     6 Lemmas for Cont.thy 
     7 *)
     7 *)
     8 
     8 
     9 open Cont;
     9 open Cont;
    10 
    10 
    11 (* ------------------------------------------------------------------------ *)
    11 (* ------------------------------------------------------------------------ *)
    12 (* access to definition                                                     *)
    12 (* access to definition                                                     *)
    13 (* ------------------------------------------------------------------------ *)
    13 (* ------------------------------------------------------------------------ *)
    14 
    14 
    15 qed_goalw "contlubI" Cont.thy [contlub]
    15 qed_goalw "contlubI" thy [contlub]
    16         "! Y. is_chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))==>\
    16         "! Y. is_chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))==>\
    17 \        contlub(f)"
    17 \        contlub(f)"
    18 (fn prems =>
    18 (fn prems =>
    19         [
    19         [
    20         (cut_facts_tac prems 1),
    20         (cut_facts_tac prems 1),
    21         (atac 1)
    21         (atac 1)
    22         ]);
    22         ]);
    23 
    23 
    24 qed_goalw "contlubE" Cont.thy [contlub]
    24 qed_goalw "contlubE" thy [contlub]
    25         " contlub(f)==>\
    25         " contlub(f)==>\
    26 \         ! Y. is_chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))"
    26 \         ! Y. is_chain(Y) --> f(lub(range(Y))) = lub(range(%i. f(Y(i))))"
    27 (fn prems =>
    27 (fn prems =>
    28         [
    28         [
    29         (cut_facts_tac prems 1),
    29         (cut_facts_tac prems 1),
    30         (atac 1)
    30         (atac 1)
    31         ]);
    31         ]);
    32 
    32 
    33 
    33 
    34 qed_goalw "contI" Cont.thy [cont]
    34 qed_goalw "contI" thy [cont]
    35  "! Y. is_chain(Y) --> range(% i.f(Y(i))) <<| f(lub(range(Y))) ==> cont(f)"
    35  "! Y. is_chain(Y) --> range(% i.f(Y(i))) <<| f(lub(range(Y))) ==> cont(f)"
    36 (fn prems =>
    36 (fn prems =>
    37         [
    37         [
    38         (cut_facts_tac prems 1),
    38         (cut_facts_tac prems 1),
    39         (atac 1)
    39         (atac 1)
    40         ]);
    40         ]);
    41 
    41 
    42 qed_goalw "contE" Cont.thy [cont]
    42 qed_goalw "contE" thy [cont]
    43  "cont(f) ==> ! Y. is_chain(Y) --> range(% i.f(Y(i))) <<| f(lub(range(Y)))"
    43  "cont(f) ==> ! Y. is_chain(Y) --> range(% i.f(Y(i))) <<| f(lub(range(Y)))"
    44 (fn prems =>
    44 (fn prems =>
    45         [
    45         [
    46         (cut_facts_tac prems 1),
    46         (cut_facts_tac prems 1),
    47         (atac 1)
    47         (atac 1)
    48         ]);
    48         ]);
    49 
    49 
    50 
    50 
    51 qed_goalw "monofunI" Cont.thy [monofun]
    51 qed_goalw "monofunI" thy [monofun]
    52         "! x y. x << y --> f(x) << f(y) ==> monofun(f)"
    52         "! x y. x << y --> f(x) << f(y) ==> monofun(f)"
    53 (fn prems =>
    53 (fn prems =>
    54         [
    54         [
    55         (cut_facts_tac prems 1),
    55         (cut_facts_tac prems 1),
    56         (atac 1)
    56         (atac 1)
    57         ]);
    57         ]);
    58 
    58 
    59 qed_goalw "monofunE" Cont.thy [monofun]
    59 qed_goalw "monofunE" thy [monofun]
    60         "monofun(f) ==> ! x y. x << y --> f(x) << f(y)"
    60         "monofun(f) ==> ! x y. x << y --> f(x) << f(y)"
    61 (fn prems =>
    61 (fn prems =>
    62         [
    62         [
    63         (cut_facts_tac prems 1),
    63         (cut_facts_tac prems 1),
    64         (atac 1)
    64         (atac 1)
    71 
    71 
    72 (* ------------------------------------------------------------------------ *)
    72 (* ------------------------------------------------------------------------ *)
    73 (* monotone functions map chains to chains                                  *)
    73 (* monotone functions map chains to chains                                  *)
    74 (* ------------------------------------------------------------------------ *)
    74 (* ------------------------------------------------------------------------ *)
    75 
    75 
    76 qed_goal "ch2ch_monofun" Cont.thy 
    76 qed_goal "ch2ch_monofun" thy 
    77         "[| monofun(f); is_chain(Y) |] ==> is_chain(%i. f(Y(i)))"
    77         "[| monofun(f); is_chain(Y) |] ==> is_chain(%i. f(Y(i)))"
    78 (fn prems =>
    78 (fn prems =>
    79         [
    79         [
    80         (cut_facts_tac prems 1),
    80         (cut_facts_tac prems 1),
    81         (rtac is_chainI 1),
    81         (rtac is_chainI 1),
    86 
    86 
    87 (* ------------------------------------------------------------------------ *)
    87 (* ------------------------------------------------------------------------ *)
    88 (* monotone functions map upper bound to upper bounds                       *)
    88 (* monotone functions map upper bound to upper bounds                       *)
    89 (* ------------------------------------------------------------------------ *)
    89 (* ------------------------------------------------------------------------ *)
    90 
    90 
    91 qed_goal "ub2ub_monofun" Cont.thy 
    91 qed_goal "ub2ub_monofun" thy 
    92  "[| monofun(f); range(Y) <| u|]  ==> range(%i.f(Y(i))) <| f(u)"
    92  "[| monofun(f); range(Y) <| u|]  ==> range(%i.f(Y(i))) <| f(u)"
    93 (fn prems =>
    93 (fn prems =>
    94         [
    94         [
    95         (cut_facts_tac prems 1),
    95         (cut_facts_tac prems 1),
    96         (rtac ub_rangeI 1),
    96         (rtac ub_rangeI 1),
   101 
   101 
   102 (* ------------------------------------------------------------------------ *)
   102 (* ------------------------------------------------------------------------ *)
   103 (* left to right: monofun(f) & contlub(f)  ==> cont(f)                     *)
   103 (* left to right: monofun(f) & contlub(f)  ==> cont(f)                     *)
   104 (* ------------------------------------------------------------------------ *)
   104 (* ------------------------------------------------------------------------ *)
   105 
   105 
   106 qed_goalw "monocontlub2cont" Cont.thy [cont]
   106 qed_goalw "monocontlub2cont" thy [cont]
   107         "[|monofun(f);contlub(f)|] ==> cont(f)"
   107         "[|monofun(f);contlub(f)|] ==> cont(f)"
   108 (fn prems =>
   108 (fn prems =>
   109         [
   109         [
   110         (cut_facts_tac prems 1),
   110         (cut_facts_tac prems 1),
   111         (strip_tac 1),
   111         (strip_tac 1),
   118 
   118 
   119 (* ------------------------------------------------------------------------ *)
   119 (* ------------------------------------------------------------------------ *)
   120 (* first a lemma about binary chains                                        *)
   120 (* first a lemma about binary chains                                        *)
   121 (* ------------------------------------------------------------------------ *)
   121 (* ------------------------------------------------------------------------ *)
   122 
   122 
   123 qed_goal "binchain_cont" Cont.thy
   123 qed_goal "binchain_cont" thy
   124 "[| cont(f); x << y |]  ==> range(%i. f(if i = 0 then x else y)) <<| f(y)"
   124 "[| cont(f); x << y |]  ==> range(%i. f(if i = 0 then x else y)) <<| f(y)"
   125 (fn prems => 
   125 (fn prems => 
   126         [
   126         [
   127         (cut_facts_tac prems 1),
   127         (cut_facts_tac prems 1),
   128         (rtac subst 1), 
   128         (rtac subst 1), 
   135 (* ------------------------------------------------------------------------ *)
   135 (* ------------------------------------------------------------------------ *)
   136 (* right to left: cont(f) ==> monofun(f) & contlub(f)                      *)
   136 (* right to left: cont(f) ==> monofun(f) & contlub(f)                      *)
   137 (* part1:         cont(f) ==> monofun(f                                    *)
   137 (* part1:         cont(f) ==> monofun(f                                    *)
   138 (* ------------------------------------------------------------------------ *)
   138 (* ------------------------------------------------------------------------ *)
   139 
   139 
   140 qed_goalw "cont2mono" Cont.thy [monofun]
   140 qed_goalw "cont2mono" thy [monofun]
   141         "cont(f) ==> monofun(f)"
   141         "cont(f) ==> monofun(f)"
   142 (fn prems =>
   142 (fn prems =>
   143         [
   143         [
   144         (cut_facts_tac prems 1),
   144         (cut_facts_tac prems 1),
   145         (strip_tac 1),
   145         (strip_tac 1),
   153 (* ------------------------------------------------------------------------ *)
   153 (* ------------------------------------------------------------------------ *)
   154 (* right to left: cont(f) ==> monofun(f) & contlub(f)                      *)
   154 (* right to left: cont(f) ==> monofun(f) & contlub(f)                      *)
   155 (* part2:         cont(f) ==>              contlub(f)                      *)
   155 (* part2:         cont(f) ==>              contlub(f)                      *)
   156 (* ------------------------------------------------------------------------ *)
   156 (* ------------------------------------------------------------------------ *)
   157 
   157 
   158 qed_goalw "cont2contlub" Cont.thy [contlub]
   158 qed_goalw "cont2contlub" thy [contlub]
   159         "cont(f) ==> contlub(f)"
   159         "cont(f) ==> contlub(f)"
   160 (fn prems =>
   160 (fn prems =>
   161         [
   161         [
   162         (cut_facts_tac prems 1),
   162         (cut_facts_tac prems 1),
   163         (strip_tac 1),
   163         (strip_tac 1),
   168 
   168 
   169 (* ------------------------------------------------------------------------ *)
   169 (* ------------------------------------------------------------------------ *)
   170 (* monotone functions map finite chains to finite chains              	    *)
   170 (* monotone functions map finite chains to finite chains              	    *)
   171 (* ------------------------------------------------------------------------ *)
   171 (* ------------------------------------------------------------------------ *)
   172 
   172 
   173 qed_goalw "monofun_finch2finch" Cont.thy [finite_chain_def]
   173 qed_goalw "monofun_finch2finch" thy [finite_chain_def]
   174   "[| monofun f; finite_chain Y |] ==> finite_chain (%n. f (Y n))" 
   174   "[| monofun f; finite_chain Y |] ==> finite_chain (%n. f (Y n))" 
   175 (fn prems => 
   175 (fn prems => 
   176 	[
   176 	[
   177 	cut_facts_tac prems 1,
   177 	cut_facts_tac prems 1,
   178 	safe_tac HOL_cs,
   178 	safe_tac HOL_cs,
   191 (* ------------------------------------------------------------------------ *)
   191 (* ------------------------------------------------------------------------ *)
   192 (* The following results are about a curried function that is monotone      *)
   192 (* The following results are about a curried function that is monotone      *)
   193 (* in both arguments                                                        *)
   193 (* in both arguments                                                        *)
   194 (* ------------------------------------------------------------------------ *)
   194 (* ------------------------------------------------------------------------ *)
   195 
   195 
   196 qed_goal "ch2ch_MF2L" Cont.thy 
   196 qed_goal "ch2ch_MF2L" thy 
   197 "[|monofun(MF2); is_chain(F)|] ==> is_chain(%i. MF2 (F i) x)"
   197 "[|monofun(MF2); is_chain(F)|] ==> is_chain(%i. MF2 (F i) x)"
   198 (fn prems =>
   198 (fn prems =>
   199         [
   199         [
   200         (cut_facts_tac prems 1),
   200         (cut_facts_tac prems 1),
   201         (etac (ch2ch_monofun RS ch2ch_fun) 1),
   201         (etac (ch2ch_monofun RS ch2ch_fun) 1),
   202         (atac 1)
   202         (atac 1)
   203         ]);
   203         ]);
   204 
   204 
   205 
   205 
   206 qed_goal "ch2ch_MF2R" Cont.thy 
   206 qed_goal "ch2ch_MF2R" thy 
   207 "[|monofun(MF2(f)); is_chain(Y)|] ==> is_chain(%i. MF2 f (Y i))"
   207 "[|monofun(MF2(f)); is_chain(Y)|] ==> is_chain(%i. MF2 f (Y i))"
   208 (fn prems =>
   208 (fn prems =>
   209         [
   209         [
   210         (cut_facts_tac prems 1),
   210         (cut_facts_tac prems 1),
   211         (etac ch2ch_monofun 1),
   211         (etac ch2ch_monofun 1),
   212         (atac 1)
   212         (atac 1)
   213         ]);
   213         ]);
   214 
   214 
   215 qed_goal "ch2ch_MF2LR" Cont.thy 
   215 qed_goal "ch2ch_MF2LR" thy 
   216 "[|monofun(MF2); !f.monofun(MF2(f)); is_chain(F); is_chain(Y)|] ==> \
   216 "[|monofun(MF2); !f.monofun(MF2(f)); is_chain(F); is_chain(Y)|] ==> \
   217 \  is_chain(%i. MF2(F(i))(Y(i)))"
   217 \  is_chain(%i. MF2(F(i))(Y(i)))"
   218  (fn prems =>
   218  (fn prems =>
   219         [
   219         [
   220         (cut_facts_tac prems 1),
   220         (cut_facts_tac prems 1),
   226         ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)),
   226         ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)),
   227         (etac (is_chainE RS spec) 1)
   227         (etac (is_chainE RS spec) 1)
   228         ]);
   228         ]);
   229 
   229 
   230 
   230 
   231 qed_goal "ch2ch_lubMF2R" Cont.thy 
   231 qed_goal "ch2ch_lubMF2R" thy 
   232 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   232 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   233 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   233 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   234 \       is_chain(F);is_chain(Y)|] ==> \
   234 \       is_chain(F);is_chain(Y)|] ==> \
   235 \       is_chain(%j. lub(range(%i. MF2 (F j) (Y i))))"
   235 \       is_chain(%j. lub(range(%i. MF2 (F j) (Y i))))"
   236 (fn prems =>
   236 (fn prems =>
   246         (etac ch2ch_MF2L 1),
   246         (etac ch2ch_MF2L 1),
   247         (atac 1)
   247         (atac 1)
   248         ]);
   248         ]);
   249 
   249 
   250 
   250 
   251 qed_goal "ch2ch_lubMF2L" Cont.thy 
   251 qed_goal "ch2ch_lubMF2L" thy 
   252 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   252 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   253 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   253 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   254 \       is_chain(F);is_chain(Y)|] ==> \
   254 \       is_chain(F);is_chain(Y)|] ==> \
   255 \       is_chain(%i. lub(range(%j. MF2 (F j) (Y i))))"
   255 \       is_chain(%i. lub(range(%j. MF2 (F j) (Y i))))"
   256 (fn prems =>
   256 (fn prems =>
   266         ((rtac ch2ch_MF2R 1) THEN (etac spec 1)),
   266         ((rtac ch2ch_MF2R 1) THEN (etac spec 1)),
   267         (atac 1)
   267         (atac 1)
   268         ]);
   268         ]);
   269 
   269 
   270 
   270 
   271 qed_goal "lub_MF2_mono" Cont.thy 
   271 qed_goal "lub_MF2_mono" thy 
   272 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   272 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   273 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   273 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   274 \       is_chain(F)|] ==> \
   274 \       is_chain(F)|] ==> \
   275 \       monofun(% x.lub(range(% j.MF2 (F j) (x))))"
   275 \       monofun(% x.lub(range(% j.MF2 (F j) (x))))"
   276 (fn prems =>
   276 (fn prems =>
   286         (strip_tac 1),
   286         (strip_tac 1),
   287         ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)),
   287         ((rtac (monofunE RS spec RS spec RS mp) 1) THEN (etac spec 1)),
   288         (atac 1)
   288         (atac 1)
   289         ]);
   289         ]);
   290 
   290 
   291 qed_goal "ex_lubMF2" Cont.thy 
   291 qed_goal "ex_lubMF2" thy 
   292 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   292 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   293 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   293 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   294 \       is_chain(F); is_chain(Y)|] ==> \
   294 \       is_chain(F); is_chain(Y)|] ==> \
   295 \               lub(range(%j. lub(range(%i. MF2(F j) (Y i))))) =\
   295 \               lub(range(%j. lub(range(%i. MF2(F j) (Y i))))) =\
   296 \               lub(range(%i. lub(range(%j. MF2(F j) (Y i)))))"
   296 \               lub(range(%i. lub(range(%j. MF2(F j) (Y i)))))"
   325         ((rtac ch2ch_MF2R 1) THEN (etac spec 1)),
   325         ((rtac ch2ch_MF2R 1) THEN (etac spec 1)),
   326         (atac 1)
   326         (atac 1)
   327         ]);
   327         ]);
   328 
   328 
   329 
   329 
   330 qed_goal "diag_lubMF2_1" Cont.thy 
   330 qed_goal "diag_lubMF2_1" thy 
   331 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   331 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   332 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   332 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   333 \  is_chain(FY);is_chain(TY)|] ==>\
   333 \  is_chain(FY);is_chain(TY)|] ==>\
   334 \ lub(range(%i. lub(range(%j. MF2(FY(j))(TY(i)))))) =\
   334 \ lub(range(%i. lub(range(%j. MF2(FY(j))(TY(i)))))) =\
   335 \ lub(range(%i. MF2(FY(i))(TY(i))))"
   335 \ lub(range(%i. MF2(FY(i))(TY(i))))"
   369         (rtac is_ub_thelub 1),
   369         (rtac is_ub_thelub 1),
   370         (etac ch2ch_MF2L 1),
   370         (etac ch2ch_MF2L 1),
   371         (atac 1)
   371         (atac 1)
   372         ]);
   372         ]);
   373 
   373 
   374 qed_goal "diag_lubMF2_2" Cont.thy 
   374 qed_goal "diag_lubMF2_2" thy 
   375 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   375 "[|monofun(MF2::('a::po=>'b::po=>'c::pcpo));\
   376 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   376 \  !f.monofun(MF2(f)::('b::po=>'c::pcpo));\
   377 \  is_chain(FY);is_chain(TY)|] ==>\
   377 \  is_chain(FY);is_chain(TY)|] ==>\
   378 \ lub(range(%j. lub(range(%i. MF2(FY(j))(TY(i)))))) =\
   378 \ lub(range(%j. lub(range(%i. MF2(FY(j))(TY(i)))))) =\
   379 \ lub(range(%i. MF2(FY(i))(TY(i))))"
   379 \ lub(range(%i. MF2(FY(i))(TY(i))))"
   393 (* ------------------------------------------------------------------------ *)
   393 (* ------------------------------------------------------------------------ *)
   394 (* The following results are about a curried function that is continuous    *)
   394 (* The following results are about a curried function that is continuous    *)
   395 (* in both arguments                                                        *)
   395 (* in both arguments                                                        *)
   396 (* ------------------------------------------------------------------------ *)
   396 (* ------------------------------------------------------------------------ *)
   397 
   397 
   398 qed_goal "contlub_CF2" Cont.thy 
   398 qed_goal "contlub_CF2" thy 
   399 "[|cont(CF2);!f.cont(CF2(f));is_chain(FY);is_chain(TY)|] ==>\
   399 "[|cont(CF2);!f.cont(CF2(f));is_chain(FY);is_chain(TY)|] ==>\
   400 \ CF2(lub(range(FY)))(lub(range(TY))) = lub(range(%i.CF2(FY(i))(TY(i))))"
   400 \ CF2(lub(range(FY)))(lub(range(TY))) = lub(range(%i.CF2(FY(i))(TY(i))))"
   401  (fn prems =>
   401  (fn prems =>
   402         [
   402         [
   403         (cut_facts_tac prems 1),
   403         (cut_facts_tac prems 1),
   419 
   419 
   420 (* ------------------------------------------------------------------------ *)
   420 (* ------------------------------------------------------------------------ *)
   421 (* The following results are about application for functions in 'a=>'b      *)
   421 (* The following results are about application for functions in 'a=>'b      *)
   422 (* ------------------------------------------------------------------------ *)
   422 (* ------------------------------------------------------------------------ *)
   423 
   423 
   424 qed_goal "monofun_fun_fun" Cont.thy 
   424 qed_goal "monofun_fun_fun" thy 
   425         "f1 << f2 ==> f1(x) << f2(x)"
   425         "f1 << f2 ==> f1(x) << f2(x)"
   426 (fn prems =>
   426 (fn prems =>
   427         [
   427         [
   428         (cut_facts_tac prems 1),
   428         (cut_facts_tac prems 1),
   429         (etac (less_fun RS iffD1 RS spec) 1)
   429         (etac (less_fun RS iffD1 RS spec) 1)
   430         ]);
   430         ]);
   431 
   431 
   432 qed_goal "monofun_fun_arg" Cont.thy 
   432 qed_goal "monofun_fun_arg" thy 
   433         "[|monofun(f); x1 << x2|] ==> f(x1) << f(x2)"
   433         "[|monofun(f); x1 << x2|] ==> f(x1) << f(x2)"
   434 (fn prems =>
   434 (fn prems =>
   435         [
   435         [
   436         (cut_facts_tac prems 1),
   436         (cut_facts_tac prems 1),
   437         (etac (monofunE RS spec RS spec RS mp) 1),
   437         (etac (monofunE RS spec RS spec RS mp) 1),
   438         (atac 1)
   438         (atac 1)
   439         ]);
   439         ]);
   440 
   440 
   441 qed_goal "monofun_fun" Cont.thy 
   441 qed_goal "monofun_fun" thy 
   442 "[|monofun(f1); monofun(f2); f1 << f2; x1 << x2|] ==> f1(x1) << f2(x2)"
   442 "[|monofun(f1); monofun(f2); f1 << f2; x1 << x2|] ==> f1(x1) << f2(x2)"
   443 (fn prems =>
   443 (fn prems =>
   444         [
   444         [
   445         (cut_facts_tac prems 1),
   445         (cut_facts_tac prems 1),
   446         (rtac trans_less 1),
   446         (rtac trans_less 1),
   453 (* ------------------------------------------------------------------------ *)
   453 (* ------------------------------------------------------------------------ *)
   454 (* The following results are about the propagation of monotonicity and      *)
   454 (* The following results are about the propagation of monotonicity and      *)
   455 (* continuity                                                               *)
   455 (* continuity                                                               *)
   456 (* ------------------------------------------------------------------------ *)
   456 (* ------------------------------------------------------------------------ *)
   457 
   457 
   458 qed_goal "mono2mono_MF1L" Cont.thy 
   458 qed_goal "mono2mono_MF1L" thy 
   459         "[|monofun(c1)|] ==> monofun(%x. c1 x y)"
   459         "[|monofun(c1)|] ==> monofun(%x. c1 x y)"
   460 (fn prems =>
   460 (fn prems =>
   461         [
   461         [
   462         (cut_facts_tac prems 1),
   462         (cut_facts_tac prems 1),
   463         (rtac monofunI 1),
   463         (rtac monofunI 1),
   464         (strip_tac 1),
   464         (strip_tac 1),
   465         (etac (monofun_fun_arg RS monofun_fun_fun) 1),
   465         (etac (monofun_fun_arg RS monofun_fun_fun) 1),
   466         (atac 1)
   466         (atac 1)
   467         ]);
   467         ]);
   468 
   468 
   469 qed_goal "cont2cont_CF1L" Cont.thy 
   469 qed_goal "cont2cont_CF1L" thy 
   470         "[|cont(c1)|] ==> cont(%x. c1 x y)"
   470         "[|cont(c1)|] ==> cont(%x. c1 x y)"
   471 (fn prems =>
   471 (fn prems =>
   472         [
   472         [
   473         (cut_facts_tac prems 1),
   473         (cut_facts_tac prems 1),
   474         (rtac monocontlub2cont 1),
   474         (rtac monocontlub2cont 1),
   485         (rtac refl 1)
   485         (rtac refl 1)
   486         ]);
   486         ]);
   487 
   487 
   488 (*********  Note "(%x.%y.c1 x y) = c1" ***********)
   488 (*********  Note "(%x.%y.c1 x y) = c1" ***********)
   489 
   489 
   490 qed_goal "mono2mono_MF1L_rev" Cont.thy
   490 qed_goal "mono2mono_MF1L_rev" thy
   491         "!y.monofun(%x.c1 x y) ==> monofun(c1)"
   491         "!y.monofun(%x.c1 x y) ==> monofun(c1)"
   492 (fn prems =>
   492 (fn prems =>
   493         [
   493         [
   494         (cut_facts_tac prems 1),
   494         (cut_facts_tac prems 1),
   495         (rtac monofunI 1),
   495         (rtac monofunI 1),
   498         (strip_tac 1),
   498         (strip_tac 1),
   499         (rtac ((hd prems) RS spec RS monofunE RS spec RS spec RS mp) 1),
   499         (rtac ((hd prems) RS spec RS monofunE RS spec RS spec RS mp) 1),
   500         (atac 1)
   500         (atac 1)
   501         ]);
   501         ]);
   502 
   502 
   503 qed_goal "cont2cont_CF1L_rev" Cont.thy
   503 qed_goal "cont2cont_CF1L_rev" thy
   504         "!y.cont(%x.c1 x y) ==> cont(c1)"
   504         "!y.cont(%x.c1 x y) ==> cont(c1)"
   505 (fn prems =>
   505 (fn prems =>
   506         [
   506         [
   507         (cut_facts_tac prems 1),
   507         (cut_facts_tac prems 1),
   508         (rtac monocontlub2cont 1),
   508         (rtac monocontlub2cont 1),
   524 (* ------------------------------------------------------------------------ *)
   524 (* ------------------------------------------------------------------------ *)
   525 (* What D.A.Schmidt calls continuity of abstraction                         *)
   525 (* What D.A.Schmidt calls continuity of abstraction                         *)
   526 (* never used here                                                          *)
   526 (* never used here                                                          *)
   527 (* ------------------------------------------------------------------------ *)
   527 (* ------------------------------------------------------------------------ *)
   528 
   528 
   529 qed_goal "contlub_abstraction" Cont.thy
   529 qed_goal "contlub_abstraction" thy
   530 "[|is_chain(Y::nat=>'a);!y.cont(%x.(c::'a=>'b=>'c) x y)|] ==>\
   530 "[|is_chain(Y::nat=>'a);!y.cont(%x.(c::'a=>'b=>'c) x y)|] ==>\
   531 \ (%y.lub(range(%i.c (Y i) y))) = (lub(range(%i.%y.c (Y i) y)))"
   531 \ (%y.lub(range(%i.c (Y i) y))) = (lub(range(%i.%y.c (Y i) y)))"
   532  (fn prems =>
   532  (fn prems =>
   533         [
   533         [
   534         (cut_facts_tac prems 1),
   534         (cut_facts_tac prems 1),
   541         (etac spec 1),
   541         (etac spec 1),
   542         (atac 1)
   542         (atac 1)
   543         ]);
   543         ]);
   544 
   544 
   545 
   545 
   546 qed_goal "mono2mono_app" Cont.thy 
   546 qed_goal "mono2mono_app" thy 
   547 "[|monofun(ft);!x.monofun(ft(x));monofun(tt)|] ==>\
   547 "[|monofun(ft);!x.monofun(ft(x));monofun(tt)|] ==>\
   548 \        monofun(%x.(ft(x))(tt(x)))"
   548 \        monofun(%x.(ft(x))(tt(x)))"
   549  (fn prems =>
   549  (fn prems =>
   550         [
   550         [
   551         (cut_facts_tac prems 1),
   551         (cut_facts_tac prems 1),
   559         (etac (monofunE RS spec RS spec RS mp) 1),
   559         (etac (monofunE RS spec RS spec RS mp) 1),
   560         (atac 1)
   560         (atac 1)
   561         ]);
   561         ]);
   562 
   562 
   563 
   563 
   564 qed_goal "cont2contlub_app" Cont.thy 
   564 qed_goal "cont2contlub_app" thy 
   565 "[|cont(ft);!x.cont(ft(x));cont(tt)|] ==> contlub(%x.(ft(x))(tt(x)))"
   565 "[|cont(ft);!x.cont(ft(x));cont(tt)|] ==> contlub(%x.(ft(x))(tt(x)))"
   566  (fn prems =>
   566  (fn prems =>
   567         [
   567         [
   568         (cut_facts_tac prems 1),
   568         (cut_facts_tac prems 1),
   569         (rtac contlubI 1),
   569         (rtac contlubI 1),
   576         (etac (cont2mono RS ch2ch_monofun) 1),
   576         (etac (cont2mono RS ch2ch_monofun) 1),
   577         (atac 1)
   577         (atac 1)
   578         ]);
   578         ]);
   579 
   579 
   580 
   580 
   581 qed_goal "cont2cont_app" Cont.thy 
   581 qed_goal "cont2cont_app" thy 
   582 "[|cont(ft);!x.cont(ft(x));cont(tt)|] ==>\
   582 "[|cont(ft);!x.cont(ft(x));cont(tt)|] ==>\
   583 \        cont(%x.(ft(x))(tt(x)))"
   583 \        cont(%x.(ft(x))(tt(x)))"
   584  (fn prems =>
   584  (fn prems =>
   585         [
   585         [
   586         (rtac monocontlub2cont 1),
   586         (rtac monocontlub2cont 1),
   607 
   607 
   608 (* ------------------------------------------------------------------------ *)
   608 (* ------------------------------------------------------------------------ *)
   609 (* The identity function is continuous                                      *)
   609 (* The identity function is continuous                                      *)
   610 (* ------------------------------------------------------------------------ *)
   610 (* ------------------------------------------------------------------------ *)
   611 
   611 
   612 qed_goal "cont_id" Cont.thy "cont(% x.x)"
   612 qed_goal "cont_id" thy "cont(% x.x)"
   613  (fn prems =>
   613  (fn prems =>
   614         [
   614         [
   615         (rtac contI 1),
   615         (rtac contI 1),
   616         (strip_tac 1),
   616         (strip_tac 1),
   617         (etac thelubE 1),
   617         (etac thelubE 1),
   618         (rtac refl 1)
   618         (rtac refl 1)
   619         ]);
   619         ]);
   620 
   620 
   621 
       
   622 
       
   623 (* ------------------------------------------------------------------------ *)
   621 (* ------------------------------------------------------------------------ *)
   624 (* constant functions are continuous                                        *)
   622 (* constant functions are continuous                                        *)
   625 (* ------------------------------------------------------------------------ *)
   623 (* ------------------------------------------------------------------------ *)
   626 
   624 
   627 qed_goalw "cont_const" Cont.thy [cont] "cont(%x.c)"
   625 qed_goalw "cont_const" thy [cont] "cont(%x.c)"
   628  (fn prems =>
   626  (fn prems =>
   629         [
   627         [
   630         (strip_tac 1),
   628         (strip_tac 1),
   631         (rtac is_lubI 1),
   629         (rtac is_lubI 1),
   632         (rtac conjI 1),
   630         (rtac conjI 1),
   637         (dtac ub_rangeE 1),
   635         (dtac ub_rangeE 1),
   638         (etac spec 1)
   636         (etac spec 1)
   639         ]);
   637         ]);
   640 
   638 
   641 
   639 
   642 qed_goal "cont2cont_app3" Cont.thy 
   640 qed_goal "cont2cont_app3" thy 
   643  "[|cont(f);cont(t) |] ==> cont(%x. f(t(x)))"
   641  "[|cont(f);cont(t) |] ==> cont(%x. f(t(x)))"
   644  (fn prems =>
   642  (fn prems =>
   645         [
   643         [
   646         (cut_facts_tac prems 1),
   644         (cut_facts_tac prems 1),
   647         (rtac cont2cont_app2 1),
   645         (rtac cont2cont_app2 1),
   648         (rtac cont_const 1),
   646         (rtac cont_const 1),
   649         (atac 1),
   647         (atac 1),
   650         (atac 1)
   648         (atac 1)
   651         ]);
   649         ]);
   652 
   650 
       
   651 (* ------------------------------------------------------------------------ *)
       
   652 (* A non-emptyness result for Cfun                                          *)
       
   653 (* ------------------------------------------------------------------------ *)
       
   654 
       
   655 qed_goal "CfunI" thy "?x:Collect cont"
       
   656  (fn prems =>
       
   657         [
       
   658         (rtac CollectI 1),
       
   659         (rtac cont_const 1)
       
   660         ]);