src/HOLCF/Up2.ML
author paulson
Thu, 29 Jun 2000 12:15:08 +0200
changeset 9187 68ecc04785f1
parent 9169 85a47aa21f74
child 9245 428385c4bc50
permissions -rw-r--r--
fixed proof to cope with the default of equalityCE instead of equalityE
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     1
(*  Title:      HOLCF/Up2.ML
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     2
    ID:         $Id$
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     3
    Author:     Franz Regensburger
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     4
    Copyright   1993 Technische Universitaet Muenchen
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     5
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
     6
Lemmas for Up2.thy 
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     7
*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
     8
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
     9
(* for compatibility with old HOLCF-Version *)
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    10
Goal "(op <<)=(%x1 x2. case Rep_Up(x1) of \               
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    11
\               Inl(y1) => True \
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    12
\             | Inr(y2) => (case Rep_Up(x2) of Inl(z1) => False \
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    13
\                                            | Inr(z2) => y2<<z2))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    14
by (fold_goals_tac [less_up_def]);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    15
by (rtac refl 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    16
qed "inst_up_po";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    17
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    18
(* -------------------------------------------------------------------------*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    19
(* type ('a)u is pointed                                                    *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    20
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    21
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    22
Goal "Abs_Up(Inl ()) << z";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    23
by (simp_tac (simpset() addsimps [less_up1a]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    24
qed "minimal_up";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    25
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    26
bind_thm ("UU_up_def",minimal_up RS minimal2UU RS sym);
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    27
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    28
Goal "? x::'a u.!y. x<<y";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    29
by (res_inst_tac [("x","Abs_Up(Inl ())")] exI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    30
by (rtac (minimal_up RS allI) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    31
qed "least_up";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    32
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    33
(* -------------------------------------------------------------------------*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    34
(* access to less_up in class po                                          *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    35
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    36
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    37
Goal "~ Iup(x) << Abs_Up(Inl ())";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    38
by (simp_tac (simpset() addsimps [less_up1b]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    39
qed "less_up2b";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    40
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    41
Goal "(Iup(x)<<Iup(y)) = (x<<y)";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    42
by (simp_tac (simpset() addsimps [less_up1c]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    43
qed "less_up2c";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    44
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    45
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    46
(* Iup and Ifup are monotone                                               *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    47
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    48
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    49
qed_goalw "monofun_Iup" thy [monofun] "monofun(Iup)"
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    50
 (fn prems =>
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    51
        [
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    52
        (strip_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    53
        (etac (less_up2c RS iffD2) 1)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    54
        ]);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    55
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    56
qed_goalw "monofun_Ifup1" thy [monofun] "monofun(Ifup)"
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    57
 (fn prems =>
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    58
        [
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    59
        (strip_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    60
        (rtac (less_fun RS iffD2) 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    61
        (strip_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    62
        (res_inst_tac [("p","xa")] upE 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    63
        (asm_simp_tac Up0_ss 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    64
        (asm_simp_tac Up0_ss 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    65
        (etac monofun_cfun_fun 1)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    66
        ]);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    67
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2278
diff changeset
    68
qed_goalw "monofun_Ifup2" thy [monofun] "monofun(Ifup(f))"
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    69
 (fn prems =>
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    70
        [
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    71
        (strip_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    72
        (res_inst_tac [("p","x")] upE 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    73
        (asm_simp_tac Up0_ss 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    74
        (asm_simp_tac Up0_ss 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    75
        (res_inst_tac [("p","y")] upE 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    76
        (hyp_subst_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    77
        (rtac notE 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    78
        (rtac less_up2b 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    79
        (atac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    80
        (asm_simp_tac Up0_ss 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    81
        (rtac monofun_cfun_arg 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    82
        (hyp_subst_tac 1),
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    83
        (etac (less_up2c  RS iffD1) 1)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    84
        ]);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    85
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    86
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    87
(* Some kind of surjectivity lemma                                          *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    88
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    89
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    90
Goal  "z=Iup(x) ==> Iup(Ifup(LAM x. x)(z)) = z";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    91
by (asm_simp_tac Up0_ss 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    92
qed "up_lemma1";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    93
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    94
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    95
(* ('a)u is a cpo                                                           *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    96
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    97
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    98
Goal "[|chain(Y);? i x. Y(i)=Iup(x)|] \
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    99
\     ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   100
by (rtac is_lubI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   101
by (rtac conjI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   102
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   103
by (rtac allI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   104
by (res_inst_tac [("p","Y(i)")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   105
by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   106
by (etac sym 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   107
by (rtac minimal_up 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   108
by (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   109
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   110
by (rtac (less_up2c RS iffD2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   111
by (rtac is_ub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   112
by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   113
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   114
by (res_inst_tac [("p","u")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   115
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   116
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   117
by (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   118
by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   119
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   120
by (rtac less_up2b 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   121
by (hyp_subst_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   122
by (etac (ub_rangeE RS spec) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   123
by (res_inst_tac [("t","u")] (up_lemma1 RS subst) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   124
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   125
by (rtac (less_up2c RS iffD2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   126
by (rtac is_lub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   127
by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   128
by (etac (monofun_Ifup2 RS ub2ub_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   129
qed "lub_up1a";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   130
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   131
Goal "[|chain(Y);!i x. Y(i)~=Iup(x)|] ==> range(Y) <<| Abs_Up (Inl ())";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   132
by (rtac is_lubI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   133
by (rtac conjI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   134
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   135
by (rtac allI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   136
by (res_inst_tac [("p","Y(i)")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   137
by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   138
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   139
by (rtac refl_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   140
by (rtac notE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   141
by (dtac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   142
by (dtac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   143
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   144
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   145
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   146
by (rtac minimal_up 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   147
qed "lub_up1b";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   148
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   149
bind_thm ("thelub_up1a", lub_up1a RS thelubI);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   150
(*
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
   151
[| chain ?Y1; ? i x. ?Y1 i = Iup x |] ==>
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   152
 lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i))))
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   153
*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   154
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   155
bind_thm ("thelub_up1b", lub_up1b RS thelubI);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   156
(*
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
   157
[| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==>
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   158
 lub (range ?Y1) = UU_up
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   159
*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   160
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   161
Goal "chain(Y::nat=>('a)u) ==> ? x. range(Y) <<|x";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   162
by (rtac disjE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   163
by (rtac exI 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   164
by (etac lub_up1a 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   165
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   166
by (rtac exI 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   167
by (etac lub_up1b 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   168
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   169
by (fast_tac HOL_cs 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   170
qed "cpo_up";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   171