src/HOLCF/Pcpo.ML
author paulson
Tue, 04 Jul 2000 15:58:11 +0200
changeset 9245 428385c4bc50
parent 9169 85a47aa21f74
child 9248 e1dee89de037
permissions -rw-r--r--
removed most batch-style proofs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
     1
(*  Title:      HOLCF/Pcpo.ML
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     2
    ID:         $Id$
1461
6bcb44e4d6e5 expanded tabs
clasohm
parents: 1267
diff changeset
     3
    Author:     Franz Regensburger
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     4
    Copyright   1993 Technische Universitaet Muenchen
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     5
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
     6
introduction of the classes cpo and pcpo 
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     7
*)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
     8
 
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
     9
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
    10
(* ------------------------------------------------------------------------ *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
    11
(* derive the old rule minimal                                              *)
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
    12
(* ------------------------------------------------------------------------ *)
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    13
 
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    14
Goalw [UU_def] "ALL z. UU << z";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    15
by (rtac (select_eq_Ex RS iffD2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    16
by (rtac least 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    17
qed "UU_least";
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
    18
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    19
bind_thm("minimal", UU_least RS spec);
2640
ee4dfce170a0 Changes of HOLCF from Oscar Slotosch:
slotosch
parents: 2445
diff changeset
    20
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    21
(* ------------------------------------------------------------------------ *)
2839
7ca787c6efca changed some theorems from pcpo to cpo
slotosch
parents: 2640
diff changeset
    22
(* in cpo's everthing equal to THE lub has lub properties for every chain  *)
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    23
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    24
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    25
Goal "[| chain(S);lub(range(S)) = (l::'a::cpo)|] ==> range(S) <<| l ";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    26
by (hyp_subst_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    27
by (rtac lubI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    28
by (etac cpo 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    29
qed "thelubE";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    30
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    31
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    32
(* Properties of the lub                                                    *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    33
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    34
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    35
1779
1155c06fa956 introduced forgotten bind_thm calls
oheimb
parents: 1675
diff changeset
    36
bind_thm ("is_ub_thelub", cpo RS lubI RS is_ub_lub);
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
    37
(* chain(?S1) ==> ?S1(?x) << lub(range(?S1))                             *)
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    38
1779
1155c06fa956 introduced forgotten bind_thm calls
oheimb
parents: 1675
diff changeset
    39
bind_thm ("is_lub_thelub", cpo RS lubI RS is_lub_lub);
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
    40
(* [| chain(?S5); range(?S5) <| ?x1 |] ==> lub(range(?S5)) << ?x1        *)
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    41
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    42
Goal "chain Y ==> max_in_chain i Y = (lub(range(Y)) = ((Y i)::'a::cpo))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    43
by (rtac iffI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    44
by (fast_tac (HOL_cs addSIs [thelubI,lub_finch1]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    45
by (rewtac max_in_chain_def);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    46
by (safe_tac (HOL_cs addSIs [antisym_less]));
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    47
by (fast_tac (HOL_cs addSEs [chain_mono3]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    48
by (dtac sym 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    49
by (force_tac (HOL_cs addSEs [is_ub_thelub], simpset()) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    50
qed "maxinch_is_thelub";
2354
b4a1e3306aa0 added theorems
sandnerr
parents: 2275
diff changeset
    51
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    52
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    53
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    54
(* the << relation between two chains is preserved by their lubs            *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    55
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    56
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    57
Goal "[|chain(C1::(nat=>'a::cpo));chain(C2); ALL k. C1(k) << C2(k)|]\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    58
\     ==> lub(range(C1)) << lub(range(C2))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    59
by (etac is_lub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    60
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    61
by (rtac allI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    62
by (rtac trans_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    63
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    64
by (etac is_ub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    65
qed "lub_mono";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    66
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    67
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    68
(* the = relation between two chains is preserved by their lubs            *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    69
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    70
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    71
Goal "[| chain(C1::(nat=>'a::cpo));chain(C2);ALL k. C1(k)=C2(k)|]\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    72
\     ==> lub(range(C1))=lub(range(C2))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    73
by (rtac antisym_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    74
by (rtac lub_mono 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    75
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    76
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    77
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    78
by (rtac (antisym_less_inverse RS conjunct1) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    79
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    80
by (rtac lub_mono 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    81
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    82
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    83
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    84
by (rtac (antisym_less_inverse RS conjunct2) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    85
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    86
qed "lub_equal";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    87
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    88
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    89
(* more results about mono and = of lubs of chains                          *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    90
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
    91
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    92
Goal "[|EX j. ALL i. j<i --> X(i::nat)=Y(i);chain(X::nat=>'a::cpo);chain(Y)|]\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    93
\ ==> lub(range(X))<<lub(range(Y))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    94
by (etac  exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    95
by (rtac is_lub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    96
by (assume_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    97
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    98
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
    99
by (case_tac "j<i" 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   100
by (res_inst_tac [("s","Y(i)"),("t","X(i)")] subst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   101
by (rtac sym 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   102
by (Fast_tac 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 (assume_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   105
by (res_inst_tac [("y","X(Suc(j))")] trans_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   106
by (rtac (chain_mono RS mp) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   107
by (assume_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   108
by (rtac (not_less_eq 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 (res_inst_tac [("s","Y(Suc(j))"),("t","X(Suc(j))")] subst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   111
by (Asm_simp_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   112
by (etac is_ub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   113
qed "lub_mono2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   114
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   115
Goal "[|EX j. ALL i. j<i --> X(i)=Y(i); chain(X::nat=>'a::cpo); chain(Y)|]\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   116
\     ==> lub(range(X))=lub(range(Y))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   117
by (blast_tac (claset() addIs [antisym_less, lub_mono2, sym]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   118
qed "lub_equal2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   119
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   120
Goal "[|chain(Y::nat=>'a::cpo);chain(X);\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   121
\ALL i. EX j. Y(i)<< X(j)|]==> lub(range(Y))<<lub(range(X))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   122
by (rtac is_lub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   123
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   124
by (rtac ub_rangeI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   125
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   126
by (etac allE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   127
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   128
by (rtac trans_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   129
by (rtac is_ub_thelub 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   130
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   131
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   132
qed "lub_mono3";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   133
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   134
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   135
(* usefull lemmas about UU                                                  *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   136
(* ------------------------------------------------------------------------ *)
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   137
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   138
Goal "(x=UU)=(x<<UU)";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   139
by (rtac iffI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   140
by (hyp_subst_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   141
by (rtac refl_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   142
by (rtac antisym_less 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 (rtac minimal 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   145
qed "eq_UU_iff";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   146
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   147
Goal "x << UU ==> x = UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   148
by (stac eq_UU_iff 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   149
by (assume_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   150
qed "UU_I";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   151
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   152
Goal "~(x::'a::po)<<y ==> ~x=y";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   153
by Auto_tac;
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   154
qed "not_less2not_eq";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   155
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   156
Goal "[|chain(Y);lub(range(Y))=UU|] ==> ALL i. Y(i)=UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   157
by (rtac allI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   158
by (rtac antisym_less 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   159
by (rtac minimal 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   160
by (etac subst 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   161
by (etac is_ub_thelub 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   162
qed "chain_UU_I";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   163
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   164
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   165
Goal "ALL i. Y(i::nat)=UU ==> lub(range(Y::(nat=>'a::pcpo)))=UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   166
by (rtac lub_chain_maxelem 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   167
by (rtac exI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   168
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   169
by (rtac allI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   170
by (rtac (antisym_less_inverse RS conjunct1) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   171
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   172
qed "chain_UU_I_inverse";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   173
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   174
Goal "~lub(range(Y::(nat=>'a::pcpo)))=UU ==> EX i.~ Y(i)=UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   175
by (blast_tac (claset() addIs [chain_UU_I_inverse]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   176
qed "chain_UU_I_inverse2";
243
c22b85994e17 Franz Regensburger's Higher-Order Logic of Computable Functions embedding LCF
nipkow
parents:
diff changeset
   177
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   178
Goal "[| x<<y; ~x=UU |] ==> ~y=UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   179
by (blast_tac (claset() addIs [UU_I]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   180
qed "notUU_I";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   181
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   182
Goal 
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   183
 "[|EX j. ~Y(j)=UU;chain(Y::nat=>'a::pcpo)|] ==> EX j. ALL i. j<i-->~Y(i)=UU";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   184
by (blast_tac (claset() addDs [notUU_I, chain_mono RS mp]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   185
qed "chain_mono2";
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   186
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   187
(**************************************)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   188
(* some properties for chfin and flat *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   189
(**************************************)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   190
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   191
(* ------------------------------------------------------------------------ *)
4721
c8a8482a8124 renamed is_chain to chain, is_tord to tord, replaced chain_finite by chfin
oheimb
parents: 4098
diff changeset
   192
(* flat types are chfin                                              *)
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   193
(* ------------------------------------------------------------------------ *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   194
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   195
Goalw [max_in_chain_def]
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   196
     "ALL Y::nat=>'a::flat. chain Y-->(EX n. max_in_chain n Y)";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   197
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   198
by (case_tac "ALL i. Y(i)=UU" 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   199
by (res_inst_tac [("x","0")] exI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   200
by (Asm_simp_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   201
by (Asm_full_simp_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   202
by (etac exE 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   203
by (res_inst_tac [("x","i")] exI 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   204
by (strip_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   205
by (dres_inst_tac [("x","i"),("y","j")] chain_mono 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   206
by (etac (le_imp_less_or_eq RS disjE) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   207
by Safe_tac;
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   208
by (dtac (ax_flat RS spec RS spec RS mp) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   209
by (Fast_tac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   210
qed "flat_imp_chfin";
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   211
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   212
(* flat subclass of chfin --> adm_flat not needed *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   213
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   214
Goal "(a::'a::flat) ~= UU ==> a << b = (a = b)";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   215
by (safe_tac (HOL_cs addSIs [refl_less]));
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   216
by (dtac (ax_flat RS spec RS spec RS mp) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   217
by (fast_tac (HOL_cs addSIs [refl_less,ax_flat RS spec RS spec RS mp]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   218
qed "flat_eq";
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   219
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   220
Goal "chain (Y::nat=>'a::chfin) ==> finite_chain Y";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   221
by (force_tac (HOL_cs, simpset() addsimps [chfin,finite_chain_def]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   222
qed "chfin2finch";
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   223
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   224
(* ------------------------------------------------------------------------ *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   225
(* lemmata for improved admissibility introdution rule                      *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   226
(* ------------------------------------------------------------------------ *)
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   227
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   228
val prems = Goal
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   229
"[|chain Y; ALL i. P (Y i); \
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   230
\  (!!Y. [| chain Y; ALL i. P (Y i); ~ finite_chain Y |] ==> P (lub(range Y)))\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   231
\ |] ==> P (lub (range Y))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   232
by (cut_facts_tac prems 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   233
by (case_tac "finite_chain Y" 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   234
by (eresolve_tac prems 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   235
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   236
by (atac 2);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   237
by (rewtac finite_chain_def);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   238
by (safe_tac HOL_cs);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   239
by (etac (lub_finch1 RS thelubI RS ssubst) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   240
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   241
by (etac spec 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   242
qed "infinite_chain_adm_lemma";
3326
930c9bed5a09 Moved the classes flat chfin from Fix to Pcpo.
slotosch
parents: 3323
diff changeset
   243
9169
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   244
val prems = Goal
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   245
"[|chain Y;  ALL i. P (Y i); \
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   246
\  (!!Y. [| chain Y; ALL i. P (Y i);  \
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   247
\           ALL i. EX j. i < j & Y i ~= Y j & Y i << Y j|]\
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   248
\ ==> P (lub (range Y))) |] ==> P (lub (range Y))";
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   249
by (cut_facts_tac prems 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   250
by (etac infinite_chain_adm_lemma 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   251
by (atac 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   252
by (etac thin_rl 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   253
by (rewtac finite_chain_def);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   254
by (rewtac max_in_chain_def);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   255
by (fast_tac (HOL_cs addIs prems
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   256
		     addDs [le_imp_less_or_eq] addEs [chain_mono RS mp]) 1);
85a47aa21f74 tidying and unbatchifying
paulson
parents: 4721
diff changeset
   257
qed "increasing_chain_adm_lemma";