src/HOLCF/Cprod2.ML
author oheimb
Fri May 31 19:55:19 1996 +0200 (1996-05-31)
changeset 1779 1155c06fa956
parent 1461 6bcb44e4d6e5
child 2033 639de962ded4
permissions -rw-r--r--
introduced forgotten bind_thm calls
clasohm@1461
     1
(*  Title:      HOLCF/cprod2.ML
nipkow@243
     2
    ID:         $Id$
clasohm@1461
     3
    Author:     Franz Regensburger
nipkow@243
     4
    Copyright   1993 Technische Universitaet Muenchen
nipkow@243
     5
nipkow@243
     6
Lemmas for cprod2.thy 
nipkow@243
     7
*)
nipkow@243
     8
nipkow@243
     9
open Cprod2;
nipkow@243
    10
clasohm@892
    11
qed_goal "less_cprod3a" Cprod2.thy 
clasohm@1461
    12
        "p1=(UU,UU) ==> p1 << p2"
nipkow@243
    13
 (fn prems =>
clasohm@1461
    14
        [
clasohm@1461
    15
        (cut_facts_tac prems 1),
clasohm@1461
    16
        (rtac (inst_cprod_po RS ssubst) 1),
clasohm@1461
    17
        (rtac (less_cprod1b RS ssubst) 1),
clasohm@1461
    18
        (hyp_subst_tac 1),
clasohm@1461
    19
        (Asm_simp_tac  1)
clasohm@1461
    20
        ]);
nipkow@243
    21
clasohm@892
    22
qed_goal "less_cprod3b" Cprod2.thy
nipkow@243
    23
 "(p1 << p2) = (fst(p1)<<fst(p2) & snd(p1)<<snd(p2))"
nipkow@243
    24
 (fn prems =>
clasohm@1461
    25
        [
clasohm@1461
    26
        (rtac (inst_cprod_po RS ssubst) 1),
clasohm@1461
    27
        (rtac less_cprod1b 1)
clasohm@1461
    28
        ]);
nipkow@243
    29
clasohm@892
    30
qed_goal "less_cprod4a" Cprod2.thy 
clasohm@1461
    31
        "(x1,x2) << (UU,UU) ==> x1=UU & x2=UU"
nipkow@243
    32
 (fn prems =>
clasohm@1461
    33
        [
clasohm@1461
    34
        (cut_facts_tac prems 1),
clasohm@1461
    35
        (rtac less_cprod2a 1),
clasohm@1461
    36
        (etac (inst_cprod_po RS subst) 1)
clasohm@1461
    37
        ]);
nipkow@243
    38
clasohm@892
    39
qed_goal "less_cprod4b" Cprod2.thy 
clasohm@1461
    40
        "p << (UU,UU) ==> p = (UU,UU)"
nipkow@243
    41
(fn prems =>
clasohm@1461
    42
        [
clasohm@1461
    43
        (cut_facts_tac prems 1),
clasohm@1461
    44
        (rtac less_cprod2b 1),
clasohm@1461
    45
        (etac (inst_cprod_po RS subst) 1)
clasohm@1461
    46
        ]);
nipkow@243
    47
clasohm@892
    48
qed_goal "less_cprod4c" Cprod2.thy
regensbu@1168
    49
 " (xa,ya) << (x,y) ==> xa<<x & ya << y"
nipkow@243
    50
(fn prems =>
clasohm@1461
    51
        [
clasohm@1461
    52
        (cut_facts_tac prems 1),
clasohm@1461
    53
        (rtac less_cprod2c 1),
clasohm@1461
    54
        (etac (inst_cprod_po RS subst) 1),
clasohm@1461
    55
        (REPEAT (atac 1))
clasohm@1461
    56
        ]);
nipkow@243
    57
nipkow@243
    58
(* ------------------------------------------------------------------------ *)
nipkow@243
    59
(* type cprod is pointed                                                    *)
nipkow@243
    60
(* ------------------------------------------------------------------------ *)
nipkow@243
    61
regensbu@1168
    62
qed_goal "minimal_cprod" Cprod2.thy  "(UU,UU)<<p"
nipkow@243
    63
(fn prems =>
clasohm@1461
    64
        [
clasohm@1461
    65
        (rtac less_cprod3a 1),
clasohm@1461
    66
        (rtac refl 1)
clasohm@1461
    67
        ]);
nipkow@243
    68
nipkow@243
    69
(* ------------------------------------------------------------------------ *)
nipkow@243
    70
(* Pair <_,_>  is monotone in both arguments                                *)
nipkow@243
    71
(* ------------------------------------------------------------------------ *)
nipkow@243
    72
clasohm@892
    73
qed_goalw "monofun_pair1" Cprod2.thy [monofun] "monofun(Pair)"
nipkow@243
    74
 (fn prems =>
clasohm@1461
    75
        [
clasohm@1461
    76
        (strip_tac 1),
clasohm@1461
    77
        (rtac (less_fun RS iffD2) 1),
clasohm@1461
    78
        (strip_tac 1),
clasohm@1461
    79
        (rtac (less_cprod3b RS iffD2) 1),
clasohm@1461
    80
        (Simp_tac 1)
clasohm@1461
    81
        ]);
nipkow@243
    82
clasohm@892
    83
qed_goalw "monofun_pair2" Cprod2.thy [monofun] "monofun(Pair(x))"
nipkow@243
    84
 (fn prems =>
clasohm@1461
    85
        [
clasohm@1461
    86
        (strip_tac 1),
clasohm@1461
    87
        (rtac (less_cprod3b RS iffD2) 1),
clasohm@1461
    88
        (Simp_tac 1)
clasohm@1461
    89
        ]);
nipkow@243
    90
clasohm@892
    91
qed_goal "monofun_pair" Cprod2.thy 
regensbu@1168
    92
 "[|x1<<x2; y1<<y2|] ==> (x1,y1) << (x2,y2)"
nipkow@243
    93
 (fn prems =>
clasohm@1461
    94
        [
clasohm@1461
    95
        (cut_facts_tac prems 1),
clasohm@1461
    96
        (rtac trans_less 1),
clasohm@1461
    97
        (rtac (monofun_pair1 RS monofunE RS spec RS spec RS mp RS 
clasohm@1461
    98
        (less_fun RS iffD1 RS spec)) 1),
clasohm@1461
    99
        (rtac (monofun_pair2 RS monofunE RS spec RS spec RS mp) 2),
clasohm@1461
   100
        (atac 1),
clasohm@1461
   101
        (atac 1)
clasohm@1461
   102
        ]);
nipkow@243
   103
nipkow@243
   104
(* ------------------------------------------------------------------------ *)
nipkow@243
   105
(* fst and snd are monotone                                                 *)
nipkow@243
   106
(* ------------------------------------------------------------------------ *)
nipkow@243
   107
clasohm@892
   108
qed_goalw "monofun_fst" Cprod2.thy [monofun] "monofun(fst)"
nipkow@243
   109
 (fn prems =>
clasohm@1461
   110
        [
clasohm@1461
   111
        (strip_tac 1),
clasohm@1461
   112
        (res_inst_tac [("p","x")] PairE 1),
clasohm@1461
   113
        (hyp_subst_tac 1),
clasohm@1461
   114
        (res_inst_tac [("p","y")] PairE 1),
clasohm@1461
   115
        (hyp_subst_tac 1),
clasohm@1461
   116
        (Asm_simp_tac  1),
clasohm@1461
   117
        (etac (less_cprod4c RS conjunct1) 1)
clasohm@1461
   118
        ]);
nipkow@243
   119
clasohm@892
   120
qed_goalw "monofun_snd" Cprod2.thy [monofun] "monofun(snd)"
nipkow@243
   121
 (fn prems =>
clasohm@1461
   122
        [
clasohm@1461
   123
        (strip_tac 1),
clasohm@1461
   124
        (res_inst_tac [("p","x")] PairE 1),
clasohm@1461
   125
        (hyp_subst_tac 1),
clasohm@1461
   126
        (res_inst_tac [("p","y")] PairE 1),
clasohm@1461
   127
        (hyp_subst_tac 1),
clasohm@1461
   128
        (Asm_simp_tac  1),
clasohm@1461
   129
        (etac (less_cprod4c RS conjunct2) 1)
clasohm@1461
   130
        ]);
nipkow@243
   131
nipkow@243
   132
(* ------------------------------------------------------------------------ *)
nipkow@243
   133
(* the type 'a * 'b is a cpo                                                *)
nipkow@243
   134
(* ------------------------------------------------------------------------ *)
nipkow@243
   135
clasohm@892
   136
qed_goal "lub_cprod" Cprod2.thy 
nipkow@243
   137
" is_chain(S) ==> range(S) <<| \
regensbu@1168
   138
\   (lub(range(%i.fst(S i))),lub(range(%i.snd(S i)))) "
nipkow@243
   139
 (fn prems =>
clasohm@1461
   140
        [
clasohm@1461
   141
        (cut_facts_tac prems 1),
clasohm@1461
   142
        (rtac is_lubI 1),
clasohm@1461
   143
        (rtac conjI 1),
clasohm@1461
   144
        (rtac ub_rangeI 1),
clasohm@1461
   145
        (rtac allI 1),
clasohm@1461
   146
        (res_inst_tac [("t","S(i)")] (surjective_pairing RS ssubst) 1),
clasohm@1461
   147
        (rtac monofun_pair 1),
clasohm@1461
   148
        (rtac is_ub_thelub 1),
clasohm@1461
   149
        (etac (monofun_fst RS ch2ch_monofun) 1),
clasohm@1461
   150
        (rtac is_ub_thelub 1),
clasohm@1461
   151
        (etac (monofun_snd RS ch2ch_monofun) 1),
clasohm@1461
   152
        (strip_tac 1),
clasohm@1461
   153
        (res_inst_tac [("t","u")] (surjective_pairing RS ssubst) 1),
clasohm@1461
   154
        (rtac monofun_pair 1),
clasohm@1461
   155
        (rtac is_lub_thelub 1),
clasohm@1461
   156
        (etac (monofun_fst RS ch2ch_monofun) 1),
clasohm@1461
   157
        (etac (monofun_fst RS ub2ub_monofun) 1),
clasohm@1461
   158
        (rtac is_lub_thelub 1),
clasohm@1461
   159
        (etac (monofun_snd RS ch2ch_monofun) 1),
clasohm@1461
   160
        (etac (monofun_snd RS ub2ub_monofun) 1)
clasohm@1461
   161
        ]);
nipkow@243
   162
oheimb@1779
   163
bind_thm ("thelub_cprod", lub_cprod RS thelubI);
regensbu@1168
   164
(*
regensbu@1168
   165
"is_chain ?S1 ==>
regensbu@1168
   166
 lub (range ?S1) =
regensbu@1168
   167
 (lub (range (%i. fst (?S1 i))), lub (range (%i. snd (?S1 i))))" : thm
nipkow@243
   168
regensbu@1168
   169
*)
nipkow@243
   170
clasohm@892
   171
qed_goal "cpo_cprod" Cprod2.thy 
clasohm@1461
   172
        "is_chain(S::nat=>'a*'b)==>? x.range(S)<<| x"
nipkow@243
   173
(fn prems =>
clasohm@1461
   174
        [
clasohm@1461
   175
        (cut_facts_tac prems 1),
clasohm@1461
   176
        (rtac exI 1),
clasohm@1461
   177
        (etac lub_cprod 1)
clasohm@1461
   178
        ]);
nipkow@243
   179
regensbu@1168
   180