src/HOLCF/Up2.ML
author nipkow
Mon, 06 Aug 2001 13:43:24 +0200
changeset 11464 ddea204de5bc
parent 9248 e1dee89de037
child 12030 46d57d0290a2
permissions -rw-r--r--
turned translation for 1::nat into def. introduced 1' and replaced most occurrences of 1 by 1'.
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
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
     6
Class Instance u::(pcpo)po
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
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    28
Goal "EX x::'a u. ALL y. x<<y";
9169
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
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    49
Goalw [monofun]  "monofun(Iup)";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    50
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    51
by (etac (less_up2c RS iffD2) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    52
qed "monofun_Iup";
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    53
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    54
Goalw [monofun]  "monofun(Ifup)";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    55
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    56
by (rtac (less_fun RS iffD2) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    57
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    58
by (res_inst_tac [("p","xa")] upE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    59
by (asm_simp_tac Up0_ss 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    60
by (asm_simp_tac Up0_ss 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    61
by (etac monofun_cfun_fun 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    62
qed "monofun_Ifup1";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    63
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    64
Goalw [monofun]  "monofun(Ifup(f))";
9245
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    65
by (strip_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    66
by (res_inst_tac [("p","x")] upE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    67
by (asm_simp_tac Up0_ss 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    68
by (asm_simp_tac Up0_ss 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    69
by (res_inst_tac [("p","y")] upE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    70
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    71
by (rtac notE 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    72
by (rtac less_up2b 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    73
by (atac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    74
by (asm_simp_tac Up0_ss 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    75
by (rtac monofun_cfun_arg 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    76
by (hyp_subst_tac 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    77
by (etac (less_up2c  RS iffD1) 1);
428385c4bc50 removed most batch-style proofs
paulson
parents: 9169
diff changeset
    78
qed "monofun_Ifup2";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    79
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    80
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    81
(* Some kind of surjectivity lemma                                          *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    82
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    83
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    84
Goal  "z=Iup(x) ==> Iup(Ifup(LAM x. x)(z)) = z";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    85
by (asm_simp_tac Up0_ss 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    86
qed "up_lemma1";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    87
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    88
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    89
(* ('a)u is a cpo                                                           *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    90
(* ------------------------------------------------------------------------ *)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
    91
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
    92
Goal "[|chain(Y);EX i x. Y(i)=Iup(x)|] \
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    93
\     ==> range(Y) <<| Iup(lub(range(%i.(Ifup (LAM x. x) (Y(i))))))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    94
by (rtac is_lubI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    95
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    96
by (res_inst_tac [("p","Y(i)")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    97
by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] subst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    98
by (etac sym 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    99
by (rtac minimal_up 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   100
by (res_inst_tac [("t","Y(i)")] (up_lemma1 RS subst) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   101
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   102
by (rtac (less_up2c RS iffD2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   103
by (rtac is_ub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   104
by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   105
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   106
by (res_inst_tac [("p","u")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   107
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   108
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   109
by (res_inst_tac [("P","Y(i)<<Abs_Up (Inl ())")] notE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   110
by (res_inst_tac [("s","Iup(x)"),("t","Y(i)")] ssubst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   111
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   112
by (rtac less_up2b 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   113
by (hyp_subst_tac 1);
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
   114
by (etac ub_rangeD 1);
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   115
by (res_inst_tac [("t","u")] (up_lemma1 RS subst) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   116
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   117
by (rtac (less_up2c RS iffD2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   118
by (rtac is_lub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   119
by (etac (monofun_Ifup2 RS ch2ch_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   120
by (etac (monofun_Ifup2 RS ub2ub_monofun) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   121
qed "lub_up1a";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   122
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
   123
Goal "[|chain(Y); ALL i x. Y(i)~=Iup(x)|] ==> range(Y) <<| Abs_Up (Inl ())";
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   124
by (rtac is_lubI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   125
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   126
by (res_inst_tac [("p","Y(i)")] upE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   127
by (res_inst_tac [("s","Abs_Up (Inl ())"),("t","Y(i)")] ssubst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   128
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   129
by (rtac refl_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   130
by (rtac notE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   131
by (dtac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   132
by (dtac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   133
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   134
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   135
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   136
by (rtac minimal_up 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   137
qed "lub_up1b";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   138
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   139
bind_thm ("thelub_up1a", lub_up1a RS thelubI);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   140
(*
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
   141
[| chain ?Y1; EX i x. ?Y1 i = Iup x |] ==>
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   142
 lub (range ?Y1) = Iup (lub (range (%i. Iup (LAM x. x) (?Y1 i))))
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   143
*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   144
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   145
bind_thm ("thelub_up1b", lub_up1b RS thelubI);
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   146
(*
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
   147
[| chain ?Y1; ! i x. ?Y1 i ~= Iup x |] ==>
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   148
 lub (range ?Y1) = UU_up
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   149
*)
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   150
9248
e1dee89de037 massive tidy-up: goal -> Goal, remove use of prems, etc.
paulson
parents: 9245
diff changeset
   151
Goal "chain(Y::nat=>('a)u) ==> EX x. range(Y) <<|x";
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   152
by (rtac disjE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   153
by (rtac exI 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   154
by (etac lub_up1a 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   155
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   156
by (rtac exI 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   157
by (etac lub_up1b 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   158
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   159
by (fast_tac HOL_cs 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   160
qed "cpo_up";
2278
d63ffafce255 *** empty log message ***
oheimb
parents:
diff changeset
   161