src/HOLCF/Ssum2.ML
author wenzelm
Thu Aug 27 20:46:36 1998 +0200 (1998-08-27)
changeset 5400 645f46a24c72
parent 4721 c8a8482a8124
child 9169 85a47aa21f74
permissions -rw-r--r--
made tutorial first;
slotosch@2640
     1
(*  Title:      HOLCF/Ssum2.ML
nipkow@243
     2
    ID:         $Id$
clasohm@1461
     3
    Author:     Franz Regensburger
nipkow@243
     4
    Copyright   1993 Technische Universitaet Muenchen
nipkow@243
     5
slotosch@2640
     6
Lemmas for Ssum2.thy
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
open Ssum2;
nipkow@243
    10
slotosch@2640
    11
(* for compatibility with old HOLCF-Version *)
slotosch@2640
    12
qed_goal "inst_ssum_po" thy "(op <<)=(%s1 s2.@z.\
wenzelm@3842
    13
\         (! u x. s1=Isinl u & s2=Isinl x --> z = u << x)\
wenzelm@3842
    14
\        &(! v y. s1=Isinr v & s2=Isinr y --> z = v << y)\
wenzelm@3842
    15
\        &(! u y. s1=Isinl u & s2=Isinr y --> z = (u = UU))\
wenzelm@3842
    16
\        &(! v x. s1=Isinr v & s2=Isinl x --> z = (v = UU)))"
slotosch@2640
    17
 (fn prems => 
slotosch@2640
    18
        [
slotosch@3323
    19
        (fold_goals_tac [less_ssum_def]),
slotosch@2640
    20
        (rtac refl 1)
slotosch@2640
    21
        ]);
slotosch@2640
    22
nipkow@243
    23
(* ------------------------------------------------------------------------ *)
nipkow@243
    24
(* access to less_ssum in class po                                          *)
nipkow@243
    25
(* ------------------------------------------------------------------------ *)
nipkow@243
    26
slotosch@2640
    27
qed_goal "less_ssum3a" thy "Isinl x << Isinl y = x << y"
nipkow@243
    28
 (fn prems =>
clasohm@1461
    29
        [
wenzelm@4098
    30
        (simp_tac (simpset() addsimps [less_ssum2a]) 1)
clasohm@1461
    31
        ]);
nipkow@243
    32
slotosch@2640
    33
qed_goal "less_ssum3b" thy "Isinr x << Isinr y = x << y"
nipkow@243
    34
 (fn prems =>
clasohm@1461
    35
        [
wenzelm@4098
    36
        (simp_tac (simpset() addsimps [less_ssum2b]) 1)
clasohm@1461
    37
        ]);
nipkow@243
    38
slotosch@2640
    39
qed_goal "less_ssum3c" thy "Isinl x << Isinr y = (x = UU)"
nipkow@243
    40
 (fn prems =>
clasohm@1461
    41
        [
wenzelm@4098
    42
        (simp_tac (simpset() addsimps [less_ssum2c]) 1)
clasohm@1461
    43
        ]);
nipkow@243
    44
slotosch@2640
    45
qed_goal "less_ssum3d" thy "Isinr x << Isinl y = (x = UU)"
nipkow@243
    46
 (fn prems =>
clasohm@1461
    47
        [
wenzelm@4098
    48
        (simp_tac (simpset() addsimps [less_ssum2d]) 1)
clasohm@1461
    49
        ]);
nipkow@243
    50
nipkow@243
    51
(* ------------------------------------------------------------------------ *)
nipkow@243
    52
(* type ssum ++ is pointed                                                  *)
nipkow@243
    53
(* ------------------------------------------------------------------------ *)
nipkow@243
    54
slotosch@2640
    55
qed_goal "minimal_ssum" thy "Isinl UU << s"
nipkow@243
    56
 (fn prems =>
clasohm@1461
    57
        [
clasohm@1461
    58
        (res_inst_tac [("p","s")] IssumE2 1),
clasohm@1461
    59
        (hyp_subst_tac 1),
clasohm@1461
    60
        (rtac (less_ssum3a RS iffD2) 1),
clasohm@1461
    61
        (rtac minimal 1),
clasohm@1461
    62
        (hyp_subst_tac 1),
paulson@2033
    63
        (stac strict_IsinlIsinr 1),
clasohm@1461
    64
        (rtac (less_ssum3b RS iffD2) 1),
clasohm@1461
    65
        (rtac minimal 1)
clasohm@1461
    66
        ]);
nipkow@243
    67
slotosch@2640
    68
bind_thm ("UU_ssum_def",minimal_ssum RS minimal2UU RS sym);
slotosch@2640
    69
wenzelm@3842
    70
qed_goal "least_ssum" thy "? x::'a++'b.!y. x<<y"
slotosch@2640
    71
(fn prems =>
slotosch@2640
    72
        [
slotosch@2640
    73
        (res_inst_tac [("x","Isinl UU")] exI 1),
slotosch@2640
    74
        (rtac (minimal_ssum RS allI) 1)
slotosch@2640
    75
        ]);
nipkow@243
    76
nipkow@243
    77
(* ------------------------------------------------------------------------ *)
nipkow@243
    78
(* Isinl, Isinr are monotone                                                *)
nipkow@243
    79
(* ------------------------------------------------------------------------ *)
nipkow@243
    80
slotosch@2640
    81
qed_goalw "monofun_Isinl" thy [monofun] "monofun(Isinl)"
nipkow@243
    82
 (fn prems =>
clasohm@1461
    83
        [
clasohm@1461
    84
        (strip_tac 1),
clasohm@1461
    85
        (etac (less_ssum3a RS iffD2) 1)
clasohm@1461
    86
        ]);
nipkow@243
    87
slotosch@2640
    88
qed_goalw "monofun_Isinr" thy [monofun] "monofun(Isinr)"
nipkow@243
    89
 (fn prems =>
clasohm@1461
    90
        [
clasohm@1461
    91
        (strip_tac 1),
clasohm@1461
    92
        (etac (less_ssum3b RS iffD2) 1)
clasohm@1461
    93
        ]);
nipkow@243
    94
nipkow@243
    95
nipkow@243
    96
(* ------------------------------------------------------------------------ *)
nipkow@243
    97
(* Iwhen is monotone in all arguments                                       *)
nipkow@243
    98
(* ------------------------------------------------------------------------ *)
nipkow@243
    99
nipkow@243
   100
slotosch@2640
   101
qed_goalw "monofun_Iwhen1" thy [monofun] "monofun(Iwhen)"
nipkow@243
   102
 (fn prems =>
clasohm@1461
   103
        [
clasohm@1461
   104
        (strip_tac 1),
clasohm@1461
   105
        (rtac (less_fun RS iffD2) 1),
clasohm@1461
   106
        (strip_tac 1),
clasohm@1461
   107
        (rtac (less_fun RS iffD2) 1),
clasohm@1461
   108
        (strip_tac 1),
clasohm@1461
   109
        (res_inst_tac [("p","xb")] IssumE 1),
clasohm@1461
   110
        (hyp_subst_tac 1),
regensbu@1277
   111
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   112
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   113
        (etac monofun_cfun_fun 1),
regensbu@1277
   114
        (asm_simp_tac Ssum0_ss 1)
clasohm@1461
   115
        ]);
nipkow@243
   116
slotosch@2640
   117
qed_goalw "monofun_Iwhen2" thy [monofun] "monofun(Iwhen(f))"
nipkow@243
   118
 (fn prems =>
clasohm@1461
   119
        [
clasohm@1461
   120
        (strip_tac 1),
clasohm@1461
   121
        (rtac (less_fun RS iffD2) 1),
clasohm@1461
   122
        (strip_tac 1),
clasohm@1461
   123
        (res_inst_tac [("p","xa")] IssumE 1),
clasohm@1461
   124
        (hyp_subst_tac 1),
regensbu@1277
   125
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   126
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   127
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   128
        (etac monofun_cfun_fun 1)
clasohm@1461
   129
        ]);
nipkow@243
   130
slotosch@2640
   131
qed_goalw "monofun_Iwhen3" thy [monofun] "monofun(Iwhen(f)(g))"
nipkow@243
   132
 (fn prems =>
clasohm@1461
   133
        [
clasohm@1461
   134
        (strip_tac 1),
clasohm@1461
   135
        (res_inst_tac [("p","x")] IssumE 1),
clasohm@1461
   136
        (hyp_subst_tac 1),
regensbu@1277
   137
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   138
        (hyp_subst_tac 1),
clasohm@1461
   139
        (res_inst_tac [("p","y")] IssumE 1),
clasohm@1461
   140
        (hyp_subst_tac 1),
regensbu@1277
   141
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   142
        (res_inst_tac  [("P","xa=UU")] notE 1),
clasohm@1461
   143
        (atac 1),
clasohm@1461
   144
        (rtac UU_I 1),
clasohm@1461
   145
        (rtac (less_ssum3a  RS iffD1) 1),
clasohm@1461
   146
        (atac 1),
clasohm@1461
   147
        (hyp_subst_tac 1),
regensbu@1277
   148
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   149
        (rtac monofun_cfun_arg 1),
clasohm@1461
   150
        (etac (less_ssum3a  RS iffD1) 1),
clasohm@1461
   151
        (hyp_subst_tac 1),
clasohm@1461
   152
        (res_inst_tac [("s","UU"),("t","xa")] subst 1),
clasohm@1461
   153
        (etac (less_ssum3c  RS iffD1 RS sym) 1),
regensbu@1277
   154
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   155
        (hyp_subst_tac 1),
clasohm@1461
   156
        (res_inst_tac [("p","y")] IssumE 1),
clasohm@1461
   157
        (hyp_subst_tac 1),
clasohm@1461
   158
        (res_inst_tac [("s","UU"),("t","ya")] subst 1),
clasohm@1461
   159
        (etac (less_ssum3d  RS iffD1 RS sym) 1),
regensbu@1277
   160
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   161
        (hyp_subst_tac 1),
clasohm@1461
   162
        (res_inst_tac [("s","UU"),("t","ya")] subst 1),
clasohm@1461
   163
        (etac (less_ssum3d  RS iffD1 RS sym) 1),
regensbu@1277
   164
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   165
        (hyp_subst_tac 1),
regensbu@1277
   166
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   167
        (rtac monofun_cfun_arg 1),
clasohm@1461
   168
        (etac (less_ssum3b  RS iffD1) 1)
clasohm@1461
   169
        ]);
nipkow@243
   170
nipkow@243
   171
nipkow@243
   172
(* ------------------------------------------------------------------------ *)
nipkow@243
   173
(* some kind of exhaustion rules for chains in 'a ++ 'b                     *)
nipkow@243
   174
(* ------------------------------------------------------------------------ *)
nipkow@243
   175
slotosch@2640
   176
qed_goal "ssum_lemma1" thy 
wenzelm@3842
   177
"[|~(!i.? x. Y(i::nat)=Isinl(x))|] ==> (? i.! x. Y(i)~=Isinl(x))"
nipkow@243
   178
 (fn prems =>
clasohm@1461
   179
        [
clasohm@1461
   180
        (cut_facts_tac prems 1),
clasohm@1461
   181
        (fast_tac HOL_cs 1)
clasohm@1461
   182
        ]);
nipkow@243
   183
slotosch@2640
   184
qed_goal "ssum_lemma2" thy 
regensbu@1168
   185
"[|(? i.!x.(Y::nat => 'a++'b)(i::nat)~=Isinl(x::'a))|] ==>\
regensbu@1168
   186
\   (? i y. (Y::nat => 'a++'b)(i::nat)=Isinr(y::'b) & y~=UU)"
nipkow@243
   187
 (fn prems =>
clasohm@1461
   188
        [
clasohm@1461
   189
        (cut_facts_tac prems 1),
clasohm@1461
   190
        (etac exE 1),
clasohm@1461
   191
        (res_inst_tac [("p","Y(i)")] IssumE 1),
clasohm@1461
   192
        (dtac spec 1),
clasohm@1461
   193
        (contr_tac 1),
clasohm@1461
   194
        (dtac spec 1),
clasohm@1461
   195
        (contr_tac 1),
clasohm@1461
   196
        (fast_tac HOL_cs 1)
clasohm@1461
   197
        ]);
nipkow@243
   198
nipkow@243
   199
slotosch@2640
   200
qed_goal "ssum_lemma3" thy 
oheimb@4721
   201
"[|chain(Y);(? i x. Y(i)=Isinr(x::'b) & (x::'b)~=UU)|] ==>\
wenzelm@3842
   202
\ (!i.? y. Y(i)=Isinr(y))"
nipkow@243
   203
 (fn prems =>
clasohm@1461
   204
        [
clasohm@1461
   205
        (cut_facts_tac prems 1),
clasohm@1461
   206
        (etac exE 1),
clasohm@1461
   207
        (etac exE 1),
clasohm@1461
   208
        (rtac allI 1),
clasohm@1461
   209
        (res_inst_tac [("p","Y(ia)")] IssumE 1),
clasohm@1461
   210
        (rtac exI 1),
clasohm@1461
   211
        (rtac trans 1),
clasohm@1461
   212
        (rtac strict_IsinlIsinr 2),
clasohm@1461
   213
        (atac 1),
clasohm@1461
   214
        (etac exI 2),
clasohm@1461
   215
        (etac conjE 1),
clasohm@1461
   216
        (res_inst_tac [("m","i"),("n","ia")] nat_less_cases 1),
clasohm@1461
   217
        (hyp_subst_tac 2),
clasohm@1461
   218
        (etac exI 2),
clasohm@1461
   219
        (eres_inst_tac [("P","x=UU")] notE 1),
clasohm@1461
   220
        (rtac (less_ssum3d RS iffD1) 1),
clasohm@1461
   221
        (eres_inst_tac [("s","Y(i)"),("t","Isinr(x)::'a++'b")] subst 1),
clasohm@1461
   222
        (eres_inst_tac [("s","Y(ia)"),("t","Isinl(xa)::'a++'b")] subst 1),
clasohm@1461
   223
        (etac (chain_mono RS mp) 1),
clasohm@1461
   224
        (atac 1),
clasohm@1461
   225
        (eres_inst_tac [("P","xa=UU")] notE 1),
clasohm@1461
   226
        (rtac (less_ssum3c RS iffD1) 1),
clasohm@1461
   227
        (eres_inst_tac [("s","Y(i)"),("t","Isinr(x)::'a++'b")] subst 1),
clasohm@1461
   228
        (eres_inst_tac [("s","Y(ia)"),("t","Isinl(xa)::'a++'b")] subst 1),
clasohm@1461
   229
        (etac (chain_mono RS mp) 1),
clasohm@1461
   230
        (atac 1)
clasohm@1461
   231
        ]);
nipkow@243
   232
slotosch@2640
   233
qed_goal "ssum_lemma4" thy 
oheimb@4721
   234
"chain(Y) ==> (!i.? x. Y(i)=Isinl(x))|(!i.? y. Y(i)=Isinr(y))"
nipkow@243
   235
 (fn prems =>
clasohm@1461
   236
        [
clasohm@1461
   237
        (cut_facts_tac prems 1),
oheimb@1675
   238
        (rtac case_split_thm 1),
clasohm@1461
   239
        (etac disjI1 1),
clasohm@1461
   240
        (rtac disjI2 1),
clasohm@1461
   241
        (etac ssum_lemma3 1),
clasohm@1461
   242
        (rtac ssum_lemma2 1),
clasohm@1461
   243
        (etac ssum_lemma1 1)
clasohm@1461
   244
        ]);
nipkow@243
   245
nipkow@243
   246
nipkow@243
   247
(* ------------------------------------------------------------------------ *)
nipkow@243
   248
(* restricted surjectivity of Isinl                                         *)
nipkow@243
   249
(* ------------------------------------------------------------------------ *)
nipkow@243
   250
slotosch@2640
   251
qed_goal "ssum_lemma5" thy 
wenzelm@3842
   252
"z=Isinl(x)==> Isinl((Iwhen (LAM x. x) (LAM y. UU))(z)) = z"
nipkow@243
   253
 (fn prems =>
clasohm@1461
   254
        [
clasohm@1461
   255
        (cut_facts_tac prems 1),
clasohm@1461
   256
        (hyp_subst_tac 1),
oheimb@1675
   257
        (case_tac "x=UU" 1),
regensbu@1277
   258
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   259
        (asm_simp_tac Ssum0_ss 1)
clasohm@1461
   260
        ]);
nipkow@243
   261
nipkow@243
   262
(* ------------------------------------------------------------------------ *)
nipkow@243
   263
(* restricted surjectivity of Isinr                                         *)
nipkow@243
   264
(* ------------------------------------------------------------------------ *)
nipkow@243
   265
slotosch@2640
   266
qed_goal "ssum_lemma6" thy 
wenzelm@3842
   267
"z=Isinr(x)==> Isinr((Iwhen (LAM y. UU) (LAM x. x))(z)) = z"
nipkow@243
   268
 (fn prems =>
clasohm@1461
   269
        [
clasohm@1461
   270
        (cut_facts_tac prems 1),
clasohm@1461
   271
        (hyp_subst_tac 1),
oheimb@1675
   272
        (case_tac "x=UU" 1),
regensbu@1277
   273
        (asm_simp_tac Ssum0_ss 1),
regensbu@1277
   274
        (asm_simp_tac Ssum0_ss 1)
clasohm@1461
   275
        ]);
nipkow@243
   276
nipkow@243
   277
(* ------------------------------------------------------------------------ *)
nipkow@243
   278
(* technical lemmas                                                         *)
nipkow@243
   279
(* ------------------------------------------------------------------------ *)
nipkow@243
   280
slotosch@2640
   281
qed_goal "ssum_lemma7" thy 
wenzelm@3842
   282
"[|Isinl(x) << z; x~=UU|] ==> ? y. z=Isinl(y) & y~=UU"
nipkow@243
   283
 (fn prems =>
clasohm@1461
   284
        [
clasohm@1461
   285
        (cut_facts_tac prems 1),
clasohm@1461
   286
        (res_inst_tac [("p","z")] IssumE 1),
clasohm@1461
   287
        (hyp_subst_tac 1),
clasohm@1461
   288
        (etac notE 1),
clasohm@1461
   289
        (rtac antisym_less 1),
clasohm@1461
   290
        (etac (less_ssum3a RS iffD1) 1),
clasohm@1461
   291
        (rtac minimal 1),
clasohm@1461
   292
        (fast_tac HOL_cs 1),
clasohm@1461
   293
        (hyp_subst_tac 1),
clasohm@1461
   294
        (rtac notE 1),
clasohm@1461
   295
        (etac (less_ssum3c RS iffD1) 2),
clasohm@1461
   296
        (atac 1)
clasohm@1461
   297
        ]);
nipkow@243
   298
slotosch@2640
   299
qed_goal "ssum_lemma8" thy 
wenzelm@3842
   300
"[|Isinr(x) << z; x~=UU|] ==> ? y. z=Isinr(y) & y~=UU"
nipkow@243
   301
 (fn prems =>
clasohm@1461
   302
        [
clasohm@1461
   303
        (cut_facts_tac prems 1),
clasohm@1461
   304
        (res_inst_tac [("p","z")] IssumE 1),
clasohm@1461
   305
        (hyp_subst_tac 1),
clasohm@1461
   306
        (etac notE 1),
clasohm@1461
   307
        (etac (less_ssum3d RS iffD1) 1),
clasohm@1461
   308
        (hyp_subst_tac 1),
clasohm@1461
   309
        (rtac notE 1),
clasohm@1461
   310
        (etac (less_ssum3d RS iffD1) 2),
clasohm@1461
   311
        (atac 1),
clasohm@1461
   312
        (fast_tac HOL_cs 1)
clasohm@1461
   313
        ]);
nipkow@243
   314
nipkow@243
   315
(* ------------------------------------------------------------------------ *)
nipkow@243
   316
(* the type 'a ++ 'b is a cpo in three steps                                *)
nipkow@243
   317
(* ------------------------------------------------------------------------ *)
nipkow@243
   318
slotosch@2640
   319
qed_goal "lub_ssum1a" thy 
oheimb@4721
   320
"[|chain(Y);(!i.? x. Y(i)=Isinl(x))|] ==>\
nipkow@243
   321
\ range(Y) <<|\
wenzelm@3842
   322
\ Isinl(lub(range(%i.(Iwhen (LAM x. x) (LAM y. UU))(Y i))))"
nipkow@243
   323
 (fn prems =>
clasohm@1461
   324
        [
clasohm@1461
   325
        (cut_facts_tac prems 1),
clasohm@1461
   326
        (rtac is_lubI 1),
clasohm@1461
   327
        (rtac conjI 1),
clasohm@1461
   328
        (rtac ub_rangeI 1),
clasohm@1461
   329
        (rtac allI 1),
clasohm@1461
   330
        (etac allE 1),
clasohm@1461
   331
        (etac exE 1),
clasohm@1461
   332
        (res_inst_tac [("t","Y(i)")] (ssum_lemma5 RS subst) 1),
clasohm@1461
   333
        (atac 1),
clasohm@1461
   334
        (rtac (monofun_Isinl RS monofunE RS spec RS spec RS mp) 1),
clasohm@1461
   335
        (rtac is_ub_thelub 1),
clasohm@1461
   336
        (etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
clasohm@1461
   337
        (strip_tac 1),
clasohm@1461
   338
        (res_inst_tac [("p","u")] IssumE2 1),
clasohm@1461
   339
        (res_inst_tac [("t","u")] (ssum_lemma5 RS subst) 1),
clasohm@1461
   340
        (atac 1),
clasohm@1461
   341
        (rtac (monofun_Isinl RS monofunE RS spec RS spec RS mp) 1),
clasohm@1461
   342
        (rtac is_lub_thelub 1),
clasohm@1461
   343
        (etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
clasohm@1461
   344
        (etac (monofun_Iwhen3 RS ub2ub_monofun) 1),
clasohm@1461
   345
        (hyp_subst_tac 1),
clasohm@1461
   346
        (rtac (less_ssum3c RS iffD2) 1),
clasohm@1461
   347
        (rtac chain_UU_I_inverse 1),
clasohm@1461
   348
        (rtac allI 1),
clasohm@1461
   349
        (res_inst_tac [("p","Y(i)")] IssumE 1),
clasohm@1461
   350
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   351
        (asm_simp_tac Ssum0_ss 2),
clasohm@1461
   352
        (etac notE 1),
clasohm@1461
   353
        (rtac (less_ssum3c RS iffD1) 1),
clasohm@1461
   354
        (res_inst_tac [("t","Isinl(x)")] subst 1),
clasohm@1461
   355
        (atac 1),
clasohm@1461
   356
        (etac (ub_rangeE RS spec) 1)
clasohm@1461
   357
        ]);
nipkow@243
   358
nipkow@243
   359
slotosch@2640
   360
qed_goal "lub_ssum1b" thy 
oheimb@4721
   361
"[|chain(Y);(!i.? x. Y(i)=Isinr(x))|] ==>\
nipkow@243
   362
\ range(Y) <<|\
wenzelm@3842
   363
\ Isinr(lub(range(%i.(Iwhen (LAM y. UU) (LAM x. x))(Y i))))"
nipkow@243
   364
 (fn prems =>
clasohm@1461
   365
        [
clasohm@1461
   366
        (cut_facts_tac prems 1),
clasohm@1461
   367
        (rtac is_lubI 1),
clasohm@1461
   368
        (rtac conjI 1),
clasohm@1461
   369
        (rtac ub_rangeI 1),
clasohm@1461
   370
        (rtac allI 1),
clasohm@1461
   371
        (etac allE 1),
clasohm@1461
   372
        (etac exE 1),
clasohm@1461
   373
        (res_inst_tac [("t","Y(i)")] (ssum_lemma6 RS subst) 1),
clasohm@1461
   374
        (atac 1),
clasohm@1461
   375
        (rtac (monofun_Isinr RS monofunE RS spec RS spec RS mp) 1),
clasohm@1461
   376
        (rtac is_ub_thelub 1),
clasohm@1461
   377
        (etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
clasohm@1461
   378
        (strip_tac 1),
clasohm@1461
   379
        (res_inst_tac [("p","u")] IssumE2 1),
clasohm@1461
   380
        (hyp_subst_tac 1),
clasohm@1461
   381
        (rtac (less_ssum3d RS iffD2) 1),
clasohm@1461
   382
        (rtac chain_UU_I_inverse 1),
clasohm@1461
   383
        (rtac allI 1),
clasohm@1461
   384
        (res_inst_tac [("p","Y(i)")] IssumE 1),
clasohm@1461
   385
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   386
        (asm_simp_tac Ssum0_ss 1),
clasohm@1461
   387
        (etac notE 1),
clasohm@1461
   388
        (rtac (less_ssum3d RS iffD1) 1),
clasohm@1461
   389
        (res_inst_tac [("t","Isinr(y)")] subst 1),
clasohm@1461
   390
        (atac 1),
clasohm@1461
   391
        (etac (ub_rangeE RS spec) 1),
clasohm@1461
   392
        (res_inst_tac [("t","u")] (ssum_lemma6 RS subst) 1),
clasohm@1461
   393
        (atac 1),
clasohm@1461
   394
        (rtac (monofun_Isinr RS monofunE RS spec RS spec RS mp) 1),
clasohm@1461
   395
        (rtac is_lub_thelub 1),
clasohm@1461
   396
        (etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
clasohm@1461
   397
        (etac (monofun_Iwhen3 RS ub2ub_monofun) 1)
clasohm@1461
   398
        ]);
nipkow@243
   399
nipkow@243
   400
oheimb@1779
   401
bind_thm ("thelub_ssum1a", lub_ssum1a RS thelubI);
regensbu@1168
   402
(*
oheimb@4721
   403
[| chain ?Y1; ! i. ? x. ?Y1 i = Isinl x |] ==>
regensbu@1168
   404
 lub (range ?Y1) = Isinl
regensbu@1168
   405
 (lub (range (%i. Iwhen (LAM x. x) (LAM y. UU) (?Y1 i))))
regensbu@1168
   406
*)
nipkow@243
   407
oheimb@1779
   408
bind_thm ("thelub_ssum1b", lub_ssum1b RS thelubI);
regensbu@1168
   409
(*
oheimb@4721
   410
[| chain ?Y1; ! i. ? x. ?Y1 i = Isinr x |] ==>
regensbu@1168
   411
 lub (range ?Y1) = Isinr
regensbu@1168
   412
 (lub (range (%i. Iwhen (LAM y. UU) (LAM x. x) (?Y1 i))))
regensbu@1168
   413
*)
nipkow@243
   414
slotosch@2640
   415
qed_goal "cpo_ssum" thy 
oheimb@4721
   416
        "chain(Y::nat=>'a ++'b) ==> ? x. range(Y) <<|x"
nipkow@243
   417
 (fn prems =>
clasohm@1461
   418
        [
clasohm@1461
   419
        (cut_facts_tac prems 1),
clasohm@1461
   420
        (rtac (ssum_lemma4 RS disjE) 1),
clasohm@1461
   421
        (atac 1),
clasohm@1461
   422
        (rtac exI 1),
clasohm@1461
   423
        (etac lub_ssum1a 1),
clasohm@1461
   424
        (atac 1),
clasohm@1461
   425
        (rtac exI 1),
clasohm@1461
   426
        (etac lub_ssum1b 1),
clasohm@1461
   427
        (atac 1)
clasohm@1461
   428
        ]);
regensbu@1168
   429