src/HOLCF/Sprod2.ML
author regensbu
Thu Jun 29 16:28:40 1995 +0200 (1995-06-29)
changeset 1168 74be52691d62
parent 892 d0dc8d057929
child 1461 6bcb44e4d6e5
permissions -rw-r--r--
The curried version of HOLCF is now just called HOLCF. The old
uncurried version is no longer supported
nipkow@243
     1
(*  Title: 	HOLCF/sprod2.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 sprod2.thy
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
nipkow@243
    10
open Sprod2;
nipkow@243
    11
nipkow@243
    12
(* ------------------------------------------------------------------------ *)
nipkow@243
    13
(* access to less_sprod in class po                                         *)
nipkow@243
    14
(* ------------------------------------------------------------------------ *)
nipkow@243
    15
clasohm@892
    16
qed_goal "less_sprod3a" Sprod2.thy 
regensbu@1168
    17
	"p1=Ispair UU UU ==> p1 << p2"
nipkow@243
    18
(fn prems =>
nipkow@243
    19
	[
nipkow@243
    20
	(cut_facts_tac prems 1),
nipkow@243
    21
	(rtac (inst_sprod_po RS ssubst) 1),
nipkow@243
    22
	(etac less_sprod1a 1)
nipkow@243
    23
	]);
nipkow@243
    24
nipkow@243
    25
clasohm@892
    26
qed_goal "less_sprod3b" Sprod2.thy
regensbu@1168
    27
 "p1~=Ispair UU UU ==>\
nipkow@243
    28
\	(p1<<p2) = (Isfst(p1)<<Isfst(p2) & Issnd(p1)<<Issnd(p2))" 
nipkow@243
    29
(fn prems =>
nipkow@243
    30
	[
nipkow@243
    31
	(cut_facts_tac prems 1),
nipkow@243
    32
	(rtac (inst_sprod_po RS ssubst) 1),
nipkow@243
    33
	(etac less_sprod1b 1)
nipkow@243
    34
	]);
nipkow@243
    35
clasohm@892
    36
qed_goal "less_sprod4b" Sprod2.thy 
regensbu@1168
    37
	"p << Ispair UU UU ==> p = Ispair UU UU"
nipkow@243
    38
(fn prems =>
nipkow@243
    39
	[
nipkow@243
    40
	(cut_facts_tac prems 1),
nipkow@243
    41
	(rtac less_sprod2b 1),
nipkow@243
    42
	(etac (inst_sprod_po RS subst) 1)
nipkow@243
    43
	]);
nipkow@243
    44
nipkow@243
    45
val less_sprod4a = (less_sprod4b RS defined_Ispair_rev);
regensbu@1168
    46
(* Ispair ?a ?b << Ispair UU UU ==> ?a = UU | ?b = UU *)
nipkow@243
    47
clasohm@892
    48
qed_goal "less_sprod4c" Sprod2.thy
regensbu@1168
    49
 "[|Ispair xa ya << Ispair x y; xa~=UU; ya~=UU; x~=UU; y~=UU|] ==>\
nipkow@243
    50
\		xa<<x & ya << y"
nipkow@243
    51
(fn prems =>
nipkow@243
    52
	[
nipkow@243
    53
	(cut_facts_tac prems 1),
nipkow@243
    54
	(rtac less_sprod2c 1),
nipkow@243
    55
	(etac (inst_sprod_po RS subst) 1),
nipkow@243
    56
	(REPEAT (atac 1))
nipkow@243
    57
	]);
nipkow@243
    58
nipkow@243
    59
(* ------------------------------------------------------------------------ *)
nipkow@243
    60
(* type sprod is pointed                                                    *)
nipkow@243
    61
(* ------------------------------------------------------------------------ *)
nipkow@243
    62
regensbu@1168
    63
qed_goal "minimal_sprod" Sprod2.thy  "Ispair UU UU << p"
nipkow@243
    64
(fn prems =>
nipkow@243
    65
	[
nipkow@243
    66
	(rtac less_sprod3a 1),
nipkow@243
    67
	(rtac refl 1)
nipkow@243
    68
	]);
nipkow@243
    69
nipkow@243
    70
(* ------------------------------------------------------------------------ *)
nipkow@243
    71
(* Ispair is monotone in both arguments                                     *)
nipkow@243
    72
(* ------------------------------------------------------------------------ *)
nipkow@243
    73
clasohm@892
    74
qed_goalw "monofun_Ispair1" Sprod2.thy [monofun] "monofun(Ispair)"
nipkow@243
    75
(fn prems =>
nipkow@243
    76
	[
nipkow@243
    77
	(strip_tac 1),
nipkow@243
    78
	(rtac (less_fun RS iffD2) 1),
nipkow@243
    79
	(strip_tac 1),
nipkow@243
    80
	(res_inst_tac [("Q",
regensbu@1168
    81
	" Ispair y xa = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
    82
	(res_inst_tac [("Q",
regensbu@1168
    83
	" Ispair x xa = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
    84
	(rtac (less_sprod3b RS iffD2) 1),
nipkow@243
    85
	(atac 1),
nipkow@243
    86
	(rtac conjI 1),
nipkow@243
    87
	(rtac (Isfst RS ssubst) 1),
nipkow@243
    88
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
    89
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
    90
	(rtac (Isfst RS ssubst) 1),
nipkow@243
    91
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
    92
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
    93
	(atac 1),
nipkow@243
    94
	(rtac (Issnd RS ssubst) 1),
nipkow@243
    95
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
    96
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
    97
	(rtac (Issnd RS ssubst) 1),
nipkow@243
    98
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
    99
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
   100
	(rtac refl_less 1),
nipkow@243
   101
	(etac less_sprod3a 1),
nipkow@243
   102
	(res_inst_tac [("Q",
regensbu@1168
   103
	" Ispair x xa  = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
   104
	(etac less_sprod3a 2),
regensbu@1168
   105
	(res_inst_tac [("P","Ispair y xa = Ispair UU UU")] notE 1),
nipkow@243
   106
	(atac 2),
nipkow@243
   107
	(rtac defined_Ispair 1),
nipkow@243
   108
	(etac notUU_I 1),
nipkow@243
   109
	(etac (strict_Ispair_rev RS  conjunct1) 1),
nipkow@243
   110
	(etac (strict_Ispair_rev RS  conjunct2) 1)
nipkow@243
   111
	]);
nipkow@243
   112
nipkow@243
   113
clasohm@892
   114
qed_goalw "monofun_Ispair2" Sprod2.thy [monofun] "monofun(Ispair(x))"
nipkow@243
   115
(fn prems =>
nipkow@243
   116
	[
nipkow@243
   117
	(strip_tac 1),
nipkow@243
   118
	(res_inst_tac [("Q",
regensbu@1168
   119
	" Ispair x y = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
   120
	(res_inst_tac [("Q",
regensbu@1168
   121
	" Ispair x xa = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
   122
	(rtac (less_sprod3b RS iffD2) 1),
nipkow@243
   123
	(atac 1),
nipkow@243
   124
	(rtac conjI 1),
nipkow@243
   125
	(rtac (Isfst RS ssubst) 1),
nipkow@243
   126
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
   127
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
   128
	(rtac (Isfst RS ssubst) 1),
nipkow@243
   129
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
   130
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
   131
	(rtac refl_less 1),
nipkow@243
   132
	(rtac (Issnd RS ssubst) 1),
nipkow@243
   133
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
   134
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
   135
	(rtac (Issnd RS ssubst) 1),
nipkow@243
   136
	(etac (strict_Ispair_rev RS conjunct1) 1),
nipkow@243
   137
	(etac (strict_Ispair_rev RS conjunct2) 1),
nipkow@243
   138
	(atac 1),
nipkow@243
   139
	(etac less_sprod3a 1),
nipkow@243
   140
	(res_inst_tac [("Q",
regensbu@1168
   141
	" Ispair x xa = Ispair UU UU")] (excluded_middle RS disjE) 1),
nipkow@243
   142
	(etac less_sprod3a 2),
regensbu@1168
   143
	(res_inst_tac [("P","Ispair x y = Ispair UU UU")] notE 1),
nipkow@243
   144
	(atac 2),
nipkow@243
   145
	(rtac defined_Ispair 1),
nipkow@243
   146
	(etac (strict_Ispair_rev RS  conjunct1) 1),
nipkow@243
   147
	(etac notUU_I 1),
nipkow@243
   148
	(etac (strict_Ispair_rev RS  conjunct2) 1)
nipkow@243
   149
	]);
nipkow@243
   150
clasohm@892
   151
qed_goal " monofun_Ispair" Sprod2.thy 
regensbu@1168
   152
 "[|x1<<x2; y1<<y2|] ==> Ispair x1 y1 << Ispair x2 y2"
nipkow@243
   153
(fn prems =>
nipkow@243
   154
	[
nipkow@243
   155
	(cut_facts_tac prems 1),
nipkow@243
   156
	(rtac trans_less 1),
nipkow@243
   157
	(rtac (monofun_Ispair1 RS monofunE RS spec RS spec RS mp RS 
nipkow@243
   158
	(less_fun RS iffD1 RS spec)) 1),
nipkow@243
   159
	(rtac (monofun_Ispair2 RS monofunE RS spec RS spec RS mp) 2),
nipkow@243
   160
	(atac 1),
nipkow@243
   161
	(atac 1)
nipkow@243
   162
	]);
nipkow@243
   163
nipkow@243
   164
nipkow@243
   165
(* ------------------------------------------------------------------------ *)
nipkow@243
   166
(* Isfst and Issnd are monotone                                             *)
nipkow@243
   167
(* ------------------------------------------------------------------------ *)
nipkow@243
   168
clasohm@892
   169
qed_goalw " monofun_Isfst" Sprod2.thy [monofun] "monofun(Isfst)"
nipkow@243
   170
(fn prems =>
nipkow@243
   171
	[
nipkow@243
   172
	(strip_tac 1),
nipkow@243
   173
	(res_inst_tac [("p","x")] IsprodE 1),
nipkow@243
   174
	(hyp_subst_tac 1),
nipkow@243
   175
	(rtac trans_less 1),
nipkow@243
   176
	(rtac minimal 2),
nipkow@243
   177
	(rtac (strict_Isfst1 RS ssubst) 1),
nipkow@243
   178
	(rtac refl_less 1),
nipkow@243
   179
	(hyp_subst_tac 1),
nipkow@243
   180
	(res_inst_tac [("p","y")] IsprodE 1),
nipkow@243
   181
	(hyp_subst_tac 1),
regensbu@1168
   182
	(res_inst_tac [("t","Isfst(Ispair xa ya)")] subst 1),
nipkow@243
   183
	(rtac refl_less 2),
nipkow@243
   184
	(etac (less_sprod4b RS sym RS arg_cong) 1),
nipkow@243
   185
	(hyp_subst_tac 1),
nipkow@243
   186
	(rtac (Isfst RS ssubst) 1),
nipkow@243
   187
	(atac 1),
nipkow@243
   188
	(atac 1),
nipkow@243
   189
	(rtac (Isfst RS ssubst) 1),
nipkow@243
   190
	(atac 1),
nipkow@243
   191
	(atac 1),
nipkow@243
   192
	(etac (less_sprod4c RS  conjunct1) 1),
nipkow@243
   193
	(REPEAT (atac 1))
nipkow@243
   194
	]);
nipkow@243
   195
clasohm@892
   196
qed_goalw "monofun_Issnd" Sprod2.thy [monofun] "monofun(Issnd)"
nipkow@243
   197
(fn prems =>
nipkow@243
   198
	[
nipkow@243
   199
	(strip_tac 1),
nipkow@243
   200
	(res_inst_tac [("p","x")] IsprodE 1),
nipkow@243
   201
	(hyp_subst_tac 1),
nipkow@243
   202
	(rtac trans_less 1),
nipkow@243
   203
	(rtac minimal 2),
nipkow@243
   204
	(rtac (strict_Issnd1 RS ssubst) 1),
nipkow@243
   205
	(rtac refl_less 1),
nipkow@243
   206
	(hyp_subst_tac 1),
nipkow@243
   207
	(res_inst_tac [("p","y")] IsprodE 1),
nipkow@243
   208
	(hyp_subst_tac 1),
regensbu@1168
   209
	(res_inst_tac [("t","Issnd(Ispair xa ya)")] subst 1),
nipkow@243
   210
	(rtac refl_less 2),
nipkow@243
   211
	(etac (less_sprod4b RS sym RS arg_cong) 1),
nipkow@243
   212
	(hyp_subst_tac 1),
nipkow@243
   213
	(rtac (Issnd RS ssubst) 1),
nipkow@243
   214
	(atac 1),
nipkow@243
   215
	(atac 1),
nipkow@243
   216
	(rtac (Issnd RS ssubst) 1),
nipkow@243
   217
	(atac 1),
nipkow@243
   218
	(atac 1),
nipkow@243
   219
	(etac (less_sprod4c RS  conjunct2) 1),
nipkow@243
   220
	(REPEAT (atac 1))
nipkow@243
   221
	]);
nipkow@243
   222
nipkow@243
   223
nipkow@243
   224
(* ------------------------------------------------------------------------ *)
nipkow@243
   225
(* the type 'a ** 'b is a cpo                                               *)
nipkow@243
   226
(* ------------------------------------------------------------------------ *)
nipkow@243
   227
clasohm@892
   228
qed_goal "lub_sprod" Sprod2.thy 
nipkow@243
   229
"[|is_chain(S)|] ==> range(S) <<| \
regensbu@1168
   230
\ Ispair (lub(range(%i.Isfst(S i)))) (lub(range(%i.Issnd(S i))))"
nipkow@243
   231
(fn prems =>
nipkow@243
   232
	[
nipkow@243
   233
	(cut_facts_tac prems 1),
nipkow@243
   234
	(rtac is_lubI 1),
nipkow@243
   235
	(rtac conjI 1),
nipkow@243
   236
	(rtac ub_rangeI 1),
nipkow@243
   237
	(rtac allI 1),
nipkow@243
   238
	(res_inst_tac [("t","S(i)")] (surjective_pairing_Sprod RS ssubst) 1),
nipkow@243
   239
	(rtac monofun_Ispair 1),
nipkow@243
   240
	(rtac is_ub_thelub 1),
nipkow@243
   241
	(etac (monofun_Isfst RS ch2ch_monofun) 1),
nipkow@243
   242
	(rtac is_ub_thelub 1),
nipkow@243
   243
	(etac (monofun_Issnd RS ch2ch_monofun) 1),
nipkow@243
   244
	(strip_tac 1),
nipkow@243
   245
	(res_inst_tac [("t","u")] (surjective_pairing_Sprod RS ssubst) 1),
nipkow@243
   246
	(rtac monofun_Ispair 1),
nipkow@243
   247
	(rtac is_lub_thelub 1),
nipkow@243
   248
	(etac (monofun_Isfst RS ch2ch_monofun) 1),
nipkow@243
   249
	(etac (monofun_Isfst RS ub2ub_monofun) 1),
nipkow@243
   250
	(rtac is_lub_thelub 1),
nipkow@243
   251
	(etac (monofun_Issnd RS ch2ch_monofun) 1),
nipkow@243
   252
	(etac (monofun_Issnd RS ub2ub_monofun) 1)
nipkow@243
   253
	]);
nipkow@243
   254
nipkow@243
   255
val thelub_sprod = (lub_sprod RS thelubI);
regensbu@1168
   256
nipkow@243
   257
clasohm@892
   258
qed_goal "cpo_sprod" Sprod2.thy 
nipkow@243
   259
	"is_chain(S::nat=>'a**'b)==>? x.range(S)<<| x"
nipkow@243
   260
(fn prems =>
nipkow@243
   261
	[
nipkow@243
   262
	(cut_facts_tac prems 1),
nipkow@243
   263
	(rtac exI 1),
nipkow@243
   264
	(etac lub_sprod 1)
nipkow@243
   265
	]);
nipkow@243
   266
nipkow@243
   267
nipkow@243
   268
nipkow@243
   269
nipkow@243
   270
nipkow@243
   271
nipkow@243
   272
nipkow@243
   273