src/HOL/BCV/JType.ML
author nipkow
Fri, 05 Jan 2001 18:48:18 +0100
changeset 10797 028d22926a41
parent 10172 3daeda3d3cd0
child 10918 9679326489cd
permissions -rw-r--r--
^^ -> ``` Univalent -> single_valued
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/BCV/JType.thy
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     2
    ID:         $Id$
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     4
    Copyright   2000 TUM
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     5
*)
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     6
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     7
Goalw [lesub_def,subtype_def] "T [=_S T";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
     8
by (Simp_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     9
qed "subtype_refl";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    10
AddIffs [subtype_refl];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    11
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    12
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    13
 "(T [=_S Integer) = (T = Integer)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    14
by (Simp_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    15
qed "subtype_Int_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    16
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    17
Goalw [lesub_def,subtype_def] "(Integer [=_S T) = (T = Integer)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    18
by (Blast_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    19
qed "Int_subtype_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    20
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    21
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    22
 "(T [=_S Void) = (T = Void)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    23
by (Simp_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    24
qed "subtype_Void_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    25
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    26
Goalw [lesub_def,subtype_def] "(Void [=_S T) = (T = Void)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    27
by (Blast_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    28
qed "Void_subtype_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    29
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    30
AddIffs [subtype_Int_conv,Int_subtype_conv,
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    31
         subtype_Void_conv,Void_subtype_conv];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    32
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    33
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    34
 "T [=_S NullT = (T=NullT)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    35
by (Simp_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    36
qed "subtype_NullT_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    37
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    38
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    39
 "NullT [=_S T = (T=NullT | (? C. T = Class C))";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    40
by (simp_tac (simpset() addsplits [ty.split]) 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    41
qed "NullT_subtype_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    42
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    43
AddIffs [NullT_subtype_conv,subtype_NullT_conv];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    44
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    45
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    46
 "T [=_S Class C = (T=NullT | (? D. T = Class D & (D,C) : S^*))";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    47
by (Simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    48
by (Blast_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    49
qed "subtype_Class_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    50
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    51
Goalw [lesub_def,subtype_def,refl_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    52
 "Class D [=_S T = (? C. T = Class C & (D,C):S^*)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    53
by (Blast_tac 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    54
qed "Class_subtype_conv";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    55
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    56
AddIffs [Class_subtype_conv,subtype_Class_conv];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    57
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    58
Goalw [lesub_def,subtype_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    59
 "[| A [=_S B; B [=_S C |] ==> A [=_S C";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    60
by (asm_full_simp_tac (simpset() addsplits [ty.split,ty.split_asm]) 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    61
by (blast_tac (claset() addDs [transD] addIs [rtrancl_trans]) 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    62
qed "subtype_transD";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    63
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    64
Goalw [order_def,subtype_def,lesub_def,is_Class_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    65
 "acyclic S ==> order (subtype S)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    66
by (dtac acyclic_impl_antisym_rtrancl 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    67
by (auto_tac (claset() addIs [rtrancl_trans],simpset() addsimps [antisymD]) );
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    68
qed "acyclic_impl_order_subtype";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    69
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    70
Goalw [acc_def,lesssub_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    71
 "wf(S^-1) ==> acc(subtype S)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    72
by (dres_inst_tac [("p","S^-1 - Id")] wf_subset 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    73
 by (Blast_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    74
by (dtac wf_trancl 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    75
by (asm_full_simp_tac (simpset() addsimps [wf_eq_minimal]) 1);
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    76
by (Clarify_tac 1);
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    77
by (rename_tac "M T" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    78
by (case_tac "EX C. Class C : M" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    79
 by (case_tac "T" 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    80
    by (Blast_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    81
   by (Blast_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    82
  by (res_inst_tac [("x","T")] bexI 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    83
   by (Blast_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    84
  by (assume_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    85
 by (Blast_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    86
by (eres_inst_tac [("x","{C. Class C : M}")] allE 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    87
by (Auto_tac);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    88
by (rename_tac "D" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    89
by (res_inst_tac [("x","Class D")] bexI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    90
 by (atac 2);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    91
by (Clarify_tac 1);
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    92
by (cut_inst_tac [("r","S")] (standard(rtrancl_r_diff_Id RS sym)) 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    93
by (Asm_full_simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    94
by (etac rtranclE 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    95
 by (Blast_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    96
by (dtac rtrancl_converseI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    97
by (subgoal_tac "(S-Id)^-1 = (S^-1 - Id)" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    98
 by (Blast_tac 2);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
    99
by (Asm_full_simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   100
by (blast_tac (claset() addIs [rtrancl_into_trancl2]) 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   101
qed "wf_converse_subcls1_impl_acc_subtype";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   102
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   103
Addsimps [is_type_def];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   104
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   105
Goalw [closed_def,plussub_def,lift2_def,err_def,JType.sup_def]
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10172
diff changeset
   106
 "[| single_valued S; acyclic S |] ==> \
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   107
\ closed (err(types S)) (lift2 (JType.sup S))";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   108
by (simp_tac (simpset() addsplits [err.split,ty.split]) 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   109
by (blast_tac (claset() addSDs [is_lub_some_lub,is_lubD,is_ubD]
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   110
                       addSIs [is_ubI]) 1);
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   111
qed "closed_err_types";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   112
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   113
AddIffs [OK_le_conv];
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   114
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   115
Goalw [semilat_def,split RS eq_reflection,JType.esl_def,Err.sl_def]
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10172
diff changeset
   116
 "[| single_valued S; acyclic S |] ==> err_semilat (JType.esl S)";
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   117
by (asm_full_simp_tac (simpset() addsimps [acyclic_impl_order_subtype,closed_err_types]) 1);
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   118
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   119
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   120
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   121
 by (case_tac "x" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   122
  by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   123
  by (Simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   124
 by (case_tac "y" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   125
  by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   126
  by (Simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   127
 by (fast_tac (claset() addDs [is_lub_some_lub,is_lubD,is_ubD] addss
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   128
             (simpset() addsimps [plussub_def,lift2_def,JType.sup_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   129
                        addsplits [ty.split])) 1);
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   130
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   131
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   132
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   133
 by (case_tac "x" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   134
  by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   135
  by (Simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   136
 by (case_tac "y" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   137
  by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   138
  by (Simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   139
 by (fast_tac (claset() addDs [is_lub_some_lub,is_lubD,is_ubD] addss
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   140
             (simpset() addsimps [plussub_def,lift2_def,JType.sup_def]
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   141
                        addsplits [ty.split])) 1);
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   142
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   143
by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   144
by (case_tac "x" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   145
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   146
by (case_tac "y" 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   147
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   148
by (asm_simp_tac(simpset() addsimps [plussub_def,lift2_def,JType.sup_def]
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   149
                          addsplits [ty.split]) 1);
10172
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   150
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   151
 by (Blast_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   152
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   153
 by (Blast_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   154
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   155
 by (Blast_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   156
by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   157
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   158
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   159
by (rtac conjI 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   160
 by (Clarify_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   161
by (Asm_full_simp_tac 1);
3daeda3d3cd0 expandshort
paulson
parents: 9791
diff changeset
   162
by (blast_tac (claset() addSDs [is_lub_some_lub,is_lubD,is_ubD]
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   163
                       addSIs [is_ubI]) 1);
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   164
qed "err_semilat_JType_esl";
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   165
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
   166
DelIffs [OK_le_conv];