src/HOLCF/ssum3.ML
author paulson
Mon Dec 07 18:26:25 1998 +0100 (1998-12-07)
changeset 6019 0e55c2fb2ebb
parent 243 c22b85994e17
permissions -rw-r--r--
tidying
nipkow@243
     1
(*  Title: 	HOLCF/ssum3.ML
nipkow@243
     2
    ID:         $Id$
nipkow@243
     3
    Author: 	Franz Regensburger
nipkow@243
     4
    Copyright   1993 Technische Universitaet Muenchen
nipkow@243
     5
nipkow@243
     6
Lemmas for ssum3.thy
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
open Ssum3;
nipkow@243
    10
nipkow@243
    11
(* ------------------------------------------------------------------------ *)
nipkow@243
    12
(* continuity for Isinl and Isinr                                           *)
nipkow@243
    13
(* ------------------------------------------------------------------------ *)
nipkow@243
    14
nipkow@243
    15
nipkow@243
    16
val contlub_Isinl = prove_goal Ssum3.thy "contlub(Isinl)"
nipkow@243
    17
 (fn prems =>
nipkow@243
    18
	[
nipkow@243
    19
	(rtac contlubI 1),
nipkow@243
    20
	(strip_tac 1),
nipkow@243
    21
	(rtac trans 1),
nipkow@243
    22
	(rtac (thelub_ssum1a RS sym) 2),
nipkow@243
    23
	(rtac allI 3),
nipkow@243
    24
	(rtac exI 3),
nipkow@243
    25
	(rtac refl 3),
nipkow@243
    26
	(etac (monofun_Isinl RS ch2ch_monofun) 2),
nipkow@243
    27
	(res_inst_tac [("Q","lub(range(Y))=UU")] classical2 1),
nipkow@243
    28
	(res_inst_tac [("s","UU"),("t","lub(range(Y))")] ssubst 1),
nipkow@243
    29
	(atac 1),
nipkow@243
    30
	(res_inst_tac [("f","Isinl")] arg_cong  1),
nipkow@243
    31
	(rtac (chain_UU_I_inverse RS sym) 1),
nipkow@243
    32
	(rtac allI 1),
nipkow@243
    33
	(res_inst_tac [("s","UU"),("t","Y(i)")] ssubst 1),
nipkow@243
    34
	(etac (chain_UU_I RS spec ) 1),
nipkow@243
    35
	(atac 1),
nipkow@243
    36
	(rtac Iwhen1 1),
nipkow@243
    37
	(res_inst_tac [("f","Isinl")] arg_cong  1),
nipkow@243
    38
	(rtac lub_equal 1),
nipkow@243
    39
	(atac 1),
nipkow@243
    40
	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
    41
	(etac (monofun_Isinl RS ch2ch_monofun) 1),
nipkow@243
    42
	(rtac allI 1),
nipkow@243
    43
	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
nipkow@243
    44
	(asm_simp_tac Ssum_ss 1),
nipkow@243
    45
	(asm_simp_tac Ssum_ss 1)
nipkow@243
    46
	]);
nipkow@243
    47
nipkow@243
    48
val contlub_Isinr = prove_goal Ssum3.thy "contlub(Isinr)"
nipkow@243
    49
 (fn prems =>
nipkow@243
    50
	[
nipkow@243
    51
	(rtac contlubI 1),
nipkow@243
    52
	(strip_tac 1),
nipkow@243
    53
	(rtac trans 1),
nipkow@243
    54
	(rtac (thelub_ssum1b RS sym) 2),
nipkow@243
    55
	(rtac allI 3),
nipkow@243
    56
	(rtac exI 3),
nipkow@243
    57
	(rtac refl 3),
nipkow@243
    58
	(etac (monofun_Isinr RS ch2ch_monofun) 2),
nipkow@243
    59
	(res_inst_tac [("Q","lub(range(Y))=UU")] classical2 1),
nipkow@243
    60
	(res_inst_tac [("s","UU"),("t","lub(range(Y))")] ssubst 1),
nipkow@243
    61
	(atac 1),
nipkow@243
    62
	((rtac arg_cong 1) THEN (rtac (chain_UU_I_inverse RS sym) 1)),
nipkow@243
    63
	(rtac allI 1),
nipkow@243
    64
	(res_inst_tac [("s","UU"),("t","Y(i)")] ssubst 1),
nipkow@243
    65
	(etac (chain_UU_I RS spec ) 1),
nipkow@243
    66
	(atac 1),
nipkow@243
    67
	(rtac (strict_IsinlIsinr RS subst) 1),
nipkow@243
    68
	(rtac Iwhen1 1),
nipkow@243
    69
	((rtac arg_cong 1) THEN (rtac lub_equal 1)),
nipkow@243
    70
	(atac 1),
nipkow@243
    71
	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
    72
	(etac (monofun_Isinr RS ch2ch_monofun) 1),
nipkow@243
    73
	(rtac allI 1),
nipkow@243
    74
	(res_inst_tac [("Q","Y(k)=UU")] classical2 1),
nipkow@243
    75
	(asm_simp_tac Ssum_ss 1),
nipkow@243
    76
	(asm_simp_tac Ssum_ss 1)
nipkow@243
    77
	]);
nipkow@243
    78
nipkow@243
    79
val contX_Isinl = prove_goal Ssum3.thy "contX(Isinl)"
nipkow@243
    80
 (fn prems =>
nipkow@243
    81
	[
nipkow@243
    82
	(rtac monocontlub2contX 1),
nipkow@243
    83
	(rtac monofun_Isinl 1),
nipkow@243
    84
	(rtac contlub_Isinl 1)
nipkow@243
    85
	]);
nipkow@243
    86
nipkow@243
    87
val contX_Isinr = prove_goal Ssum3.thy "contX(Isinr)"
nipkow@243
    88
 (fn prems =>
nipkow@243
    89
	[
nipkow@243
    90
	(rtac monocontlub2contX 1),
nipkow@243
    91
	(rtac monofun_Isinr 1),
nipkow@243
    92
	(rtac contlub_Isinr 1)
nipkow@243
    93
	]);
nipkow@243
    94
nipkow@243
    95
nipkow@243
    96
(* ------------------------------------------------------------------------ *)
nipkow@243
    97
(* continuity for Iwhen in the firts two arguments                          *)
nipkow@243
    98
(* ------------------------------------------------------------------------ *)
nipkow@243
    99
nipkow@243
   100
val contlub_Iwhen1 = prove_goal Ssum3.thy "contlub(Iwhen)"
nipkow@243
   101
 (fn prems =>
nipkow@243
   102
	[
nipkow@243
   103
	(rtac contlubI 1),
nipkow@243
   104
	(strip_tac 1),
nipkow@243
   105
	(rtac trans 1),
nipkow@243
   106
	(rtac (thelub_fun RS sym) 2),
nipkow@243
   107
	(etac (monofun_Iwhen1 RS ch2ch_monofun) 2),
nipkow@243
   108
	(rtac (expand_fun_eq RS iffD2) 1),
nipkow@243
   109
	(strip_tac 1),
nipkow@243
   110
	(rtac trans 1),
nipkow@243
   111
	(rtac (thelub_fun RS sym) 2),
nipkow@243
   112
	(rtac ch2ch_fun 2),
nipkow@243
   113
	(etac (monofun_Iwhen1 RS ch2ch_monofun) 2),
nipkow@243
   114
	(rtac (expand_fun_eq RS iffD2) 1),
nipkow@243
   115
	(strip_tac 1),
nipkow@243
   116
	(res_inst_tac [("p","xa")] IssumE 1),
nipkow@243
   117
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   118
	(rtac (lub_const RS thelubI RS sym) 1),
nipkow@243
   119
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   120
	(etac contlub_cfun_fun 1),
nipkow@243
   121
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   122
	(rtac (lub_const RS thelubI RS sym) 1)
nipkow@243
   123
	]);
nipkow@243
   124
nipkow@243
   125
val contlub_Iwhen2 = prove_goal Ssum3.thy "contlub(Iwhen(f))"
nipkow@243
   126
 (fn prems =>
nipkow@243
   127
	[
nipkow@243
   128
	(rtac contlubI 1),
nipkow@243
   129
	(strip_tac 1),
nipkow@243
   130
	(rtac trans 1),
nipkow@243
   131
	(rtac (thelub_fun RS sym) 2),
nipkow@243
   132
	(etac (monofun_Iwhen2 RS ch2ch_monofun) 2),
nipkow@243
   133
	(rtac (expand_fun_eq RS iffD2) 1),
nipkow@243
   134
	(strip_tac 1),
nipkow@243
   135
	(res_inst_tac [("p","x")] IssumE 1),
nipkow@243
   136
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   137
	(rtac (lub_const RS thelubI RS sym) 1),
nipkow@243
   138
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   139
	(rtac (lub_const RS thelubI RS sym) 1),
nipkow@243
   140
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   141
	(etac contlub_cfun_fun 1)
nipkow@243
   142
	]);
nipkow@243
   143
nipkow@243
   144
(* ------------------------------------------------------------------------ *)
nipkow@243
   145
(* continuity for Iwhen in its third argument                               *)
nipkow@243
   146
(* ------------------------------------------------------------------------ *)
nipkow@243
   147
nipkow@243
   148
(* ------------------------------------------------------------------------ *)
nipkow@243
   149
(* first 5 ugly lemmas                                                      *)
nipkow@243
   150
(* ------------------------------------------------------------------------ *)
nipkow@243
   151
nipkow@243
   152
val ssum_lemma9 = prove_goal Ssum3.thy 
nipkow@243
   153
"[| is_chain(Y); lub(range(Y)) = Isinl(x)|] ==> !i.? x.Y(i)=Isinl(x)"
nipkow@243
   154
 (fn prems =>
nipkow@243
   155
	[
nipkow@243
   156
	(cut_facts_tac prems 1),
nipkow@243
   157
	(strip_tac 1),
nipkow@243
   158
	(res_inst_tac [("p","Y(i)")] IssumE 1),
nipkow@243
   159
	(etac exI 1),
nipkow@243
   160
	(etac exI 1),
nipkow@243
   161
	(res_inst_tac [("P","y=UU")] notE 1),
nipkow@243
   162
	(atac 1),
nipkow@243
   163
	(rtac (less_ssum3d RS iffD1) 1),
nipkow@243
   164
	(etac subst 1),
nipkow@243
   165
	(etac subst 1),
nipkow@243
   166
	(etac is_ub_thelub 1)
nipkow@243
   167
	]);
nipkow@243
   168
nipkow@243
   169
nipkow@243
   170
val ssum_lemma10 = prove_goal Ssum3.thy 
nipkow@243
   171
"[| is_chain(Y); lub(range(Y)) = Isinr(x)|] ==> !i.? x.Y(i)=Isinr(x)"
nipkow@243
   172
 (fn prems =>
nipkow@243
   173
	[
nipkow@243
   174
	(cut_facts_tac prems 1),
nipkow@243
   175
	(strip_tac 1),
nipkow@243
   176
	(res_inst_tac [("p","Y(i)")] IssumE 1),
nipkow@243
   177
	(rtac exI 1),
nipkow@243
   178
	(etac trans 1),
nipkow@243
   179
	(rtac strict_IsinlIsinr 1),
nipkow@243
   180
	(etac exI 2),
nipkow@243
   181
	(res_inst_tac [("P","xa=UU")] notE 1),
nipkow@243
   182
	(atac 1),
nipkow@243
   183
	(rtac (less_ssum3c RS iffD1) 1),
nipkow@243
   184
	(etac subst 1),
nipkow@243
   185
	(etac subst 1),
nipkow@243
   186
	(etac is_ub_thelub 1)
nipkow@243
   187
	]);
nipkow@243
   188
nipkow@243
   189
val ssum_lemma11 = prove_goal Ssum3.thy 
nipkow@243
   190
"[| is_chain(Y); lub(range(Y)) = Isinl(UU) |] ==>\
nipkow@243
   191
\   Iwhen(f,g,lub(range(Y))) = lub(range(%i. Iwhen(f,g,Y(i))))"
nipkow@243
   192
 (fn prems =>
nipkow@243
   193
	[
nipkow@243
   194
	(cut_facts_tac prems 1),
nipkow@243
   195
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   196
	(rtac (chain_UU_I_inverse RS sym) 1),
nipkow@243
   197
	(rtac allI 1),
nipkow@243
   198
	(res_inst_tac [("s","Isinl(UU)"),("t","Y(i)")] subst 1),
nipkow@243
   199
	(rtac (inst_ssum_pcpo RS subst) 1),
nipkow@243
   200
	(rtac (chain_UU_I RS spec RS sym) 1),
nipkow@243
   201
	(atac 1),
nipkow@243
   202
	(etac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   203
	(asm_simp_tac Ssum_ss 1)
nipkow@243
   204
	]);
nipkow@243
   205
nipkow@243
   206
val ssum_lemma12 = prove_goal Ssum3.thy 
nipkow@243
   207
"[| is_chain(Y); lub(range(Y)) = Isinl(x); ~ x = UU |] ==>\
nipkow@243
   208
\   Iwhen(f,g,lub(range(Y))) = lub(range(%i. Iwhen(f,g,Y(i))))"
nipkow@243
   209
 (fn prems =>
nipkow@243
   210
	[
nipkow@243
   211
	(cut_facts_tac prems 1),
nipkow@243
   212
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   213
	(res_inst_tac [("t","x")] subst 1),
nipkow@243
   214
	(rtac inject_Isinl 1),
nipkow@243
   215
	(rtac trans 1),
nipkow@243
   216
	(atac 2),
nipkow@243
   217
	(rtac (thelub_ssum1a RS sym) 1),
nipkow@243
   218
	(atac 1),
nipkow@243
   219
	(etac ssum_lemma9 1),
nipkow@243
   220
	(atac 1),
nipkow@243
   221
	(rtac trans 1),
nipkow@243
   222
	(rtac contlub_cfun_arg 1),
nipkow@243
   223
	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
   224
	(atac 1),
nipkow@243
   225
	(rtac lub_equal2 1),
nipkow@243
   226
	(rtac (chain_mono2 RS exE) 1),
nipkow@243
   227
	(atac 2),
nipkow@243
   228
	(rtac chain_UU_I_inverse2 1),
nipkow@243
   229
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   230
	(etac swap 1),
nipkow@243
   231
	(rtac inject_Isinl 1),
nipkow@243
   232
	(rtac trans 1),
nipkow@243
   233
	(etac sym 1),
nipkow@243
   234
	(etac notnotD 1),
nipkow@243
   235
	(rtac exI 1),
nipkow@243
   236
	(strip_tac 1),
nipkow@243
   237
	(rtac (ssum_lemma9 RS spec RS exE) 1),
nipkow@243
   238
	(atac 1),
nipkow@243
   239
	(atac 1),
nipkow@243
   240
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   241
	(atac 1),
nipkow@243
   242
	(rtac trans 1),
nipkow@243
   243
	(rtac cfun_arg_cong 1),
nipkow@243
   244
	(rtac Iwhen2 1),
nipkow@243
   245
	(res_inst_tac [("P","Y(i)=UU")] swap 1),
nipkow@243
   246
	(fast_tac HOL_cs 1),
nipkow@243
   247
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   248
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   249
	(atac 1),
nipkow@243
   250
	(fast_tac HOL_cs 1),
nipkow@243
   251
	(rtac (Iwhen2 RS ssubst) 1),
nipkow@243
   252
	(res_inst_tac [("P","Y(i)=UU")] swap 1),
nipkow@243
   253
	(fast_tac HOL_cs 1),
nipkow@243
   254
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   255
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   256
	(atac 1),
nipkow@243
   257
	(fast_tac HOL_cs 1),
nipkow@243
   258
	(simp_tac Cfun_ss 1),
nipkow@243
   259
	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
nipkow@243
   260
	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
   261
	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
nipkow@243
   262
	]);
nipkow@243
   263
nipkow@243
   264
nipkow@243
   265
val ssum_lemma13 = prove_goal Ssum3.thy 
nipkow@243
   266
"[| is_chain(Y); lub(range(Y)) = Isinr(x); ~ x = UU |] ==>\
nipkow@243
   267
\   Iwhen(f,g,lub(range(Y))) = lub(range(%i. Iwhen(f,g,Y(i))))"
nipkow@243
   268
 (fn prems =>
nipkow@243
   269
	[
nipkow@243
   270
	(cut_facts_tac prems 1),
nipkow@243
   271
	(asm_simp_tac Ssum_ss 1),
nipkow@243
   272
	(res_inst_tac [("t","x")] subst 1),
nipkow@243
   273
	(rtac inject_Isinr 1),
nipkow@243
   274
	(rtac trans 1),
nipkow@243
   275
	(atac 2),
nipkow@243
   276
	(rtac (thelub_ssum1b RS sym) 1),
nipkow@243
   277
	(atac 1),
nipkow@243
   278
	(etac ssum_lemma10 1),
nipkow@243
   279
	(atac 1),
nipkow@243
   280
	(rtac trans 1),
nipkow@243
   281
	(rtac contlub_cfun_arg 1),
nipkow@243
   282
	(rtac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
   283
	(atac 1),
nipkow@243
   284
	(rtac lub_equal2 1),
nipkow@243
   285
	(rtac (chain_mono2 RS exE) 1),
nipkow@243
   286
	(atac 2),
nipkow@243
   287
	(rtac chain_UU_I_inverse2 1),
nipkow@243
   288
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   289
	(etac swap 1),
nipkow@243
   290
	(rtac inject_Isinr 1),
nipkow@243
   291
	(rtac trans 1),
nipkow@243
   292
	(etac sym 1),
nipkow@243
   293
	(rtac (strict_IsinlIsinr RS subst) 1),
nipkow@243
   294
	(etac notnotD 1),
nipkow@243
   295
	(rtac exI 1),
nipkow@243
   296
	(strip_tac 1),
nipkow@243
   297
	(rtac (ssum_lemma10 RS spec RS exE) 1),
nipkow@243
   298
	(atac 1),
nipkow@243
   299
	(atac 1),
nipkow@243
   300
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   301
	(atac 1),
nipkow@243
   302
	(rtac trans 1),
nipkow@243
   303
	(rtac cfun_arg_cong 1),
nipkow@243
   304
	(rtac Iwhen3 1),
nipkow@243
   305
	(res_inst_tac [("P","Y(i)=UU")] swap 1),
nipkow@243
   306
	(fast_tac HOL_cs 1),
nipkow@243
   307
	(dtac notnotD 1),
nipkow@243
   308
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   309
	(rtac (strict_IsinlIsinr RS ssubst) 1),
nipkow@243
   310
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   311
	(atac 1),
nipkow@243
   312
	(fast_tac HOL_cs 1),
nipkow@243
   313
	(rtac (Iwhen3 RS ssubst) 1),
nipkow@243
   314
	(res_inst_tac [("P","Y(i)=UU")] swap 1),
nipkow@243
   315
	(fast_tac HOL_cs 1),
nipkow@243
   316
	(dtac notnotD 1),
nipkow@243
   317
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   318
	(rtac (strict_IsinlIsinr RS ssubst) 1),
nipkow@243
   319
	(res_inst_tac [("t","Y(i)")] ssubst 1),
nipkow@243
   320
	(atac 1),
nipkow@243
   321
	(fast_tac HOL_cs 1),
nipkow@243
   322
	(simp_tac Cfun_ss 1),
nipkow@243
   323
	(rtac (monofun_fapp2 RS ch2ch_monofun) 1),
nipkow@243
   324
	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1),
nipkow@243
   325
	(etac (monofun_Iwhen3 RS ch2ch_monofun) 1)
nipkow@243
   326
	]);
nipkow@243
   327
nipkow@243
   328
nipkow@243
   329
val contlub_Iwhen3 = prove_goal Ssum3.thy "contlub(Iwhen(f)(g))"
nipkow@243
   330
 (fn prems =>
nipkow@243
   331
	[
nipkow@243
   332
	(rtac contlubI 1),
nipkow@243
   333
	(strip_tac 1),
nipkow@243
   334
	(res_inst_tac [("p","lub(range(Y))")] IssumE 1),
nipkow@243
   335
	(etac ssum_lemma11 1),
nipkow@243
   336
	(atac 1),
nipkow@243
   337
	(etac ssum_lemma12 1),
nipkow@243
   338
	(atac 1),
nipkow@243
   339
	(atac 1),
nipkow@243
   340
	(etac ssum_lemma13 1),
nipkow@243
   341
	(atac 1),
nipkow@243
   342
	(atac 1)
nipkow@243
   343
	]);
nipkow@243
   344
nipkow@243
   345
val contX_Iwhen1 = prove_goal Ssum3.thy "contX(Iwhen)"
nipkow@243
   346
 (fn prems =>
nipkow@243
   347
	[
nipkow@243
   348
	(rtac monocontlub2contX 1),
nipkow@243
   349
	(rtac monofun_Iwhen1 1),
nipkow@243
   350
	(rtac contlub_Iwhen1 1)
nipkow@243
   351
	]);
nipkow@243
   352
nipkow@243
   353
val contX_Iwhen2 = prove_goal Ssum3.thy "contX(Iwhen(f))"
nipkow@243
   354
 (fn prems =>
nipkow@243
   355
	[
nipkow@243
   356
	(rtac monocontlub2contX 1),
nipkow@243
   357
	(rtac monofun_Iwhen2 1),
nipkow@243
   358
	(rtac contlub_Iwhen2 1)
nipkow@243
   359
	]);
nipkow@243
   360
nipkow@243
   361
val contX_Iwhen3 = prove_goal Ssum3.thy "contX(Iwhen(f)(g))"
nipkow@243
   362
 (fn prems =>
nipkow@243
   363
	[
nipkow@243
   364
	(rtac monocontlub2contX 1),
nipkow@243
   365
	(rtac monofun_Iwhen3 1),
nipkow@243
   366
	(rtac contlub_Iwhen3 1)
nipkow@243
   367
	]);
nipkow@243
   368
nipkow@243
   369
(* ------------------------------------------------------------------------ *)
nipkow@243
   370
(* continuous versions of lemmas for 'a ++ 'b                               *)
nipkow@243
   371
(* ------------------------------------------------------------------------ *)
nipkow@243
   372
nipkow@243
   373
val strict_sinl = prove_goalw Ssum3.thy [sinl_def] "sinl[UU]=UU"
nipkow@243
   374
 (fn prems =>
nipkow@243
   375
	[
nipkow@243
   376
	(simp_tac (Ssum_ss addsimps [contX_Isinl]) 1),
nipkow@243
   377
	(rtac (inst_ssum_pcpo RS sym) 1)
nipkow@243
   378
	]);
nipkow@243
   379
nipkow@243
   380
val strict_sinr = prove_goalw Ssum3.thy [sinr_def] "sinr[UU]=UU"
nipkow@243
   381
 (fn prems =>
nipkow@243
   382
	[
nipkow@243
   383
	(simp_tac (Ssum_ss addsimps [contX_Isinr]) 1),
nipkow@243
   384
	(rtac (inst_ssum_pcpo RS sym) 1)
nipkow@243
   385
	]);
nipkow@243
   386
nipkow@243
   387
val noteq_sinlsinr = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   388
	"sinl[a]=sinr[b] ==> a=UU & b=UU"
nipkow@243
   389
 (fn prems =>
nipkow@243
   390
	[
nipkow@243
   391
	(cut_facts_tac prems 1),
nipkow@243
   392
	(rtac noteq_IsinlIsinr 1),
nipkow@243
   393
	(etac box_equals 1),
nipkow@243
   394
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   395
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1)
nipkow@243
   396
	]);
nipkow@243
   397
nipkow@243
   398
val inject_sinl = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   399
	"sinl[a1]=sinl[a2]==> a1=a2"
nipkow@243
   400
 (fn prems =>
nipkow@243
   401
	[
nipkow@243
   402
	(cut_facts_tac prems 1),
nipkow@243
   403
	(rtac inject_Isinl 1),
nipkow@243
   404
	(etac box_equals 1),
nipkow@243
   405
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   406
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1)
nipkow@243
   407
	]);
nipkow@243
   408
nipkow@243
   409
val inject_sinr = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   410
	"sinr[a1]=sinr[a2]==> a1=a2"
nipkow@243
   411
 (fn prems =>
nipkow@243
   412
	[
nipkow@243
   413
	(cut_facts_tac prems 1),
nipkow@243
   414
	(rtac inject_Isinr 1),
nipkow@243
   415
	(etac box_equals 1),
nipkow@243
   416
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   417
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1)
nipkow@243
   418
	]);
nipkow@243
   419
nipkow@243
   420
nipkow@243
   421
val defined_sinl = prove_goal Ssum3.thy  
nipkow@243
   422
	"~x=UU ==> ~sinl[x]=UU"
nipkow@243
   423
 (fn prems =>
nipkow@243
   424
	[
nipkow@243
   425
	(cut_facts_tac prems 1),
nipkow@243
   426
	(etac swap 1),
nipkow@243
   427
	(rtac inject_sinl 1),
nipkow@243
   428
	(rtac (strict_sinl RS ssubst) 1),
nipkow@243
   429
	(etac notnotD 1)
nipkow@243
   430
	]);
nipkow@243
   431
nipkow@243
   432
val defined_sinr = prove_goal Ssum3.thy  
nipkow@243
   433
	"~x=UU ==> ~sinr[x]=UU"
nipkow@243
   434
 (fn prems =>
nipkow@243
   435
	[
nipkow@243
   436
	(cut_facts_tac prems 1),
nipkow@243
   437
	(etac swap 1),
nipkow@243
   438
	(rtac inject_sinr 1),
nipkow@243
   439
	(rtac (strict_sinr RS ssubst) 1),
nipkow@243
   440
	(etac notnotD 1)
nipkow@243
   441
	]);
nipkow@243
   442
nipkow@243
   443
val Exh_Ssum1 = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   444
	"z=UU | (? a. z=sinl[a] & ~a=UU) | (? b. z=sinr[b] & ~b=UU)"
nipkow@243
   445
 (fn prems =>
nipkow@243
   446
	[
nipkow@243
   447
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   448
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   449
	(rtac Exh_Ssum 1)
nipkow@243
   450
	]);
nipkow@243
   451
nipkow@243
   452
nipkow@243
   453
val ssumE = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   454
	"[|p=UU ==> Q ;\
nipkow@243
   455
\	!!x.[|p=sinl[x]; ~x=UU |] ==> Q;\
nipkow@243
   456
\	!!y.[|p=sinr[y]; ~y=UU |] ==> Q|] ==> Q"
nipkow@243
   457
 (fn prems =>
nipkow@243
   458
	[
nipkow@243
   459
	(rtac IssumE 1),
nipkow@243
   460
	(resolve_tac prems 1),
nipkow@243
   461
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   462
	(atac 1),
nipkow@243
   463
	(resolve_tac prems 1),
nipkow@243
   464
	(atac 2),
nipkow@243
   465
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   466
	(resolve_tac prems 1),
nipkow@243
   467
	(atac 2),
nipkow@243
   468
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1)
nipkow@243
   469
	]);
nipkow@243
   470
nipkow@243
   471
nipkow@243
   472
val ssumE2 = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   473
      "[|!!x.[|p=sinl[x]|] ==> Q;\
nipkow@243
   474
\	!!y.[|p=sinr[y]|] ==> Q|] ==> Q"
nipkow@243
   475
 (fn prems =>
nipkow@243
   476
	[
nipkow@243
   477
	(rtac IssumE2 1),
nipkow@243
   478
	(resolve_tac prems 1),
nipkow@243
   479
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   480
	(rtac contX_Isinl 1),
nipkow@243
   481
	(atac 1),
nipkow@243
   482
	(resolve_tac prems 1),
nipkow@243
   483
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   484
	(rtac contX_Isinr 1),
nipkow@243
   485
	(atac 1)
nipkow@243
   486
	]);
nipkow@243
   487
nipkow@243
   488
val when1 = prove_goalw Ssum3.thy [when_def,sinl_def,sinr_def] 
nipkow@243
   489
	"when[f][g][UU] = UU"
nipkow@243
   490
 (fn prems =>
nipkow@243
   491
	[
nipkow@243
   492
	(rtac (inst_ssum_pcpo RS ssubst) 1),
nipkow@243
   493
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   494
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   495
		contX_Iwhen3,contX2contX_CF1L]) 1)),
nipkow@243
   496
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   497
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   498
		contX_Iwhen3,contX2contX_CF1L]) 1)),
nipkow@243
   499
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   500
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   501
		contX_Iwhen3,contX2contX_CF1L]) 1)),
nipkow@243
   502
	(simp_tac Ssum_ss  1)
nipkow@243
   503
	]);
nipkow@243
   504
nipkow@243
   505
val when2 = prove_goalw Ssum3.thy [when_def,sinl_def,sinr_def] 
nipkow@243
   506
	"~x=UU==>when[f][g][sinl[x]] = f[x]"
nipkow@243
   507
 (fn prems =>
nipkow@243
   508
	[
nipkow@243
   509
	(cut_facts_tac prems 1),
nipkow@243
   510
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   511
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   512
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   513
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   514
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   515
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   516
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   517
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   518
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   519
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   520
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   521
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   522
	(asm_simp_tac Ssum_ss  1)
nipkow@243
   523
	]);
nipkow@243
   524
nipkow@243
   525
nipkow@243
   526
nipkow@243
   527
val when3 = prove_goalw Ssum3.thy [when_def,sinl_def,sinr_def] 
nipkow@243
   528
	"~x=UU==>when[f][g][sinr[x]] = g[x]"
nipkow@243
   529
 (fn prems =>
nipkow@243
   530
	[
nipkow@243
   531
	(cut_facts_tac prems 1),
nipkow@243
   532
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   533
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   534
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   535
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   536
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   537
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   538
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   539
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   540
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   541
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   542
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   543
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   544
	(asm_simp_tac Ssum_ss  1)
nipkow@243
   545
	]);
nipkow@243
   546
nipkow@243
   547
nipkow@243
   548
val less_ssum4a = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   549
	"(sinl[x] << sinl[y]) = (x << y)"
nipkow@243
   550
 (fn prems =>
nipkow@243
   551
	[
nipkow@243
   552
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   553
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   554
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   555
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   556
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   557
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   558
	(rtac less_ssum3a 1)
nipkow@243
   559
	]);
nipkow@243
   560
nipkow@243
   561
val less_ssum4b = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   562
	"(sinr[x] << sinr[y]) = (x << y)"
nipkow@243
   563
 (fn prems =>
nipkow@243
   564
	[
nipkow@243
   565
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   566
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   567
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   568
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   569
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   570
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   571
	(rtac less_ssum3b 1)
nipkow@243
   572
	]);
nipkow@243
   573
nipkow@243
   574
val less_ssum4c = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   575
	"(sinl[x] << sinr[y]) = (x = UU)"
nipkow@243
   576
 (fn prems =>
nipkow@243
   577
	[
nipkow@243
   578
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   579
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   580
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   581
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   582
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   583
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   584
	(rtac less_ssum3c 1)
nipkow@243
   585
	]);
nipkow@243
   586
nipkow@243
   587
val less_ssum4d = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   588
	"(sinr[x] << sinl[y]) = (x = UU)"
nipkow@243
   589
 (fn prems =>
nipkow@243
   590
	[
nipkow@243
   591
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   592
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   593
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   594
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   595
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   596
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   597
	(rtac less_ssum3d 1)
nipkow@243
   598
	]);
nipkow@243
   599
nipkow@243
   600
val ssum_chainE = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   601
	"is_chain(Y) ==> (!i.? x.Y(i)=sinl[x])|(!i.? y.Y(i)=sinr[y])"
nipkow@243
   602
 (fn prems =>
nipkow@243
   603
	[
nipkow@243
   604
	(cut_facts_tac prems 1),
nipkow@243
   605
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinr,contX_Isinl]) 1),
nipkow@243
   606
	(etac ssum_lemma4 1)
nipkow@243
   607
	]);
nipkow@243
   608
nipkow@243
   609
nipkow@243
   610
val thelub_ssum2a = prove_goalw Ssum3.thy [sinl_def,sinr_def,when_def] 
nipkow@243
   611
"[| is_chain(Y); !i.? x. Y(i) = sinl[x] |] ==>\ 
nipkow@243
   612
\   lub(range(Y)) = sinl[lub(range(%i. when[LAM x. x][LAM y. UU][Y(i)]))]"
nipkow@243
   613
 (fn prems =>
nipkow@243
   614
	[
nipkow@243
   615
	(cut_facts_tac prems 1),
nipkow@243
   616
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   617
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   618
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   619
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   620
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   621
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   622
	(rtac (beta_cfun RS ext RS ssubst) 1),
nipkow@243
   623
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   624
	(rtac thelub_ssum1a 1),
nipkow@243
   625
	(atac 1),
nipkow@243
   626
	(rtac allI 1),
nipkow@243
   627
	(etac allE 1),
nipkow@243
   628
	(etac exE 1),
nipkow@243
   629
	(rtac exI 1),
nipkow@243
   630
	(etac box_equals 1),
nipkow@243
   631
	(rtac refl 1),
nipkow@243
   632
	(asm_simp_tac (Ssum_ss addsimps [contX_Isinl]) 1)
nipkow@243
   633
	]);
nipkow@243
   634
nipkow@243
   635
val thelub_ssum2b = prove_goalw Ssum3.thy [sinl_def,sinr_def,when_def] 
nipkow@243
   636
"[| is_chain(Y); !i.? x. Y(i) = sinr[x] |] ==>\ 
nipkow@243
   637
\   lub(range(Y)) = sinr[lub(range(%i. when[LAM y. UU][LAM x. x][Y(i)]))]"
nipkow@243
   638
 (fn prems =>
nipkow@243
   639
	[
nipkow@243
   640
	(cut_facts_tac prems 1),
nipkow@243
   641
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   642
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   643
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   644
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   645
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   646
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   647
	(rtac (beta_cfun RS ssubst) 1),
nipkow@243
   648
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   649
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   650
	(rtac (beta_cfun RS ext RS ssubst) 1),
nipkow@243
   651
	(REPEAT (resolve_tac (contX_lemmas @ [contX_Iwhen1,contX_Iwhen2,
nipkow@243
   652
		contX_Iwhen3,contX_Isinl,contX_Isinr,contX2contX_CF1L]) 1)),
nipkow@243
   653
	(rtac thelub_ssum1b 1),
nipkow@243
   654
	(atac 1),
nipkow@243
   655
	(rtac allI 1),
nipkow@243
   656
	(etac allE 1),
nipkow@243
   657
	(etac exE 1),
nipkow@243
   658
	(rtac exI 1),
nipkow@243
   659
	(etac box_equals 1),
nipkow@243
   660
	(rtac refl 1),
nipkow@243
   661
	(asm_simp_tac (Ssum_ss addsimps 
nipkow@243
   662
	[contX_Isinr,contX_Isinl,contX_Iwhen1,contX_Iwhen2,
nipkow@243
   663
	contX_Iwhen3]) 1)
nipkow@243
   664
	]);
nipkow@243
   665
nipkow@243
   666
val thelub_ssum2a_rev = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   667
	"[| is_chain(Y); lub(range(Y)) = sinl[x]|] ==> !i.? x.Y(i)=sinl[x]"
nipkow@243
   668
 (fn prems =>
nipkow@243
   669
	[
nipkow@243
   670
	(cut_facts_tac prems 1),
nipkow@243
   671
	(asm_simp_tac (Ssum_ss addsimps 
nipkow@243
   672
	[contX_Isinr,contX_Isinl,contX_Iwhen1,contX_Iwhen2,
nipkow@243
   673
	contX_Iwhen3]) 1),
nipkow@243
   674
	(etac ssum_lemma9 1),
nipkow@243
   675
	(asm_simp_tac (Ssum_ss addsimps 
nipkow@243
   676
	[contX_Isinr,contX_Isinl,contX_Iwhen1,contX_Iwhen2,
nipkow@243
   677
	contX_Iwhen3]) 1)
nipkow@243
   678
	]);
nipkow@243
   679
nipkow@243
   680
val thelub_ssum2b_rev = prove_goalw Ssum3.thy [sinl_def,sinr_def] 
nipkow@243
   681
	"[| is_chain(Y); lub(range(Y)) = sinr[x]|] ==> !i.? x.Y(i)=sinr[x]"
nipkow@243
   682
 (fn prems =>
nipkow@243
   683
	[
nipkow@243
   684
	(cut_facts_tac prems 1),
nipkow@243
   685
	(asm_simp_tac (Ssum_ss addsimps 
nipkow@243
   686
	[contX_Isinr,contX_Isinl,contX_Iwhen1,contX_Iwhen2,
nipkow@243
   687
	contX_Iwhen3]) 1),
nipkow@243
   688
	(etac ssum_lemma10 1),
nipkow@243
   689
	(asm_simp_tac (Ssum_ss addsimps 
nipkow@243
   690
	[contX_Isinr,contX_Isinl,contX_Iwhen1,contX_Iwhen2,
nipkow@243
   691
	contX_Iwhen3]) 1)
nipkow@243
   692
	]);
nipkow@243
   693
nipkow@243
   694
val thelub_ssum3 = prove_goal Ssum3.thy  
nipkow@243
   695
"is_chain(Y) ==>\ 
nipkow@243
   696
\   lub(range(Y)) = sinl[lub(range(%i. when[LAM x. x][LAM y. UU][Y(i)]))]\
nipkow@243
   697
\ | lub(range(Y)) = sinr[lub(range(%i. when[LAM y. UU][LAM x. x][Y(i)]))]"
nipkow@243
   698
 (fn prems =>
nipkow@243
   699
	[
nipkow@243
   700
	(cut_facts_tac prems 1),
nipkow@243
   701
	(rtac (ssum_chainE RS disjE) 1),
nipkow@243
   702
	(atac 1),
nipkow@243
   703
	(rtac disjI1 1),
nipkow@243
   704
	(etac thelub_ssum2a 1),
nipkow@243
   705
	(atac 1),
nipkow@243
   706
	(rtac disjI2 1),
nipkow@243
   707
	(etac thelub_ssum2b 1),
nipkow@243
   708
	(atac 1)
nipkow@243
   709
	]);
nipkow@243
   710
nipkow@243
   711
nipkow@243
   712
val when4 = prove_goal Ssum3.thy  
nipkow@243
   713
	"when[sinl][sinr][z]=z"
nipkow@243
   714
 (fn prems =>
nipkow@243
   715
	[
nipkow@243
   716
	(res_inst_tac [("p","z")] ssumE 1),
nipkow@243
   717
	(asm_simp_tac (Cfun_ss addsimps [when1,when2,when3]) 1),
nipkow@243
   718
	(asm_simp_tac (Cfun_ss addsimps [when1,when2,when3]) 1),
nipkow@243
   719
	(asm_simp_tac (Cfun_ss addsimps [when1,when2,when3]) 1)
nipkow@243
   720
	]);
nipkow@243
   721
nipkow@243
   722
nipkow@243
   723
(* ------------------------------------------------------------------------ *)
nipkow@243
   724
(* install simplifier for Ssum                                              *)
nipkow@243
   725
(* ------------------------------------------------------------------------ *)
nipkow@243
   726
nipkow@243
   727
val Ssum_rews = [strict_sinl,strict_sinr,when1,when2,when3];
nipkow@243
   728
val Ssum_ss = Cfun_ss addsimps Ssum_rews;