src/HOL/UNITY/Lift_prog.ML
author wenzelm
Fri, 08 Oct 1999 15:03:47 +0200
changeset 7796 624f609e10d7
parent 7688 d106cad8f515
child 7826 c6a8b73b6c2a
permissions -rw-r--r--
removed -c option;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Lift_prog.ML
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     2
    ID:         $Id$
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
     5
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
     6
THESE PROOFS CAN BE REPLACED BY INVOCATIONS OF RESULTS FROM EXTEND.ML
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     7
*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     8
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     9
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    10
val image_eqI' = read_instantiate_sg (sign_of thy)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    11
                     [("x", "?ff(i := ?u)")] image_eqI;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    12
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    13
(*** Basic properties ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    14
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    15
(** lift_set and drop_set **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    16
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    17
Goalw [lift_set_def] "(f : lift_set i A) = (f i : A)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    18
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    19
qed "lift_set_iff";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    20
AddIffs [lift_set_iff];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    21
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    22
Goalw [lift_set_def] "lift_set i A Int lift_set i B = lift_set i (A Int B)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    23
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    24
qed "Int_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    25
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    26
Goalw [lift_set_def] "lift_set i A Un lift_set i B = lift_set i (A Un B)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    27
by Auto_tac;
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    28
qed "Un_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    29
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    30
Goalw [lift_set_def] "lift_set i A - lift_set i B = lift_set i (A-B)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    31
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    32
qed "Diff_lift_set";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    33
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
    34
Addsimps [Int_lift_set, Un_lift_set, Diff_lift_set];
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    35
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    36
(*Converse fails*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    37
Goalw [drop_set_def] "f : A ==> f i : drop_set i A";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    38
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    39
qed "drop_set_I";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    40
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    41
(** lift_act and drop_act **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    42
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    43
Goalw [lift_act_def] "lift_act i Id = Id";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    44
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    45
by (etac rev_mp 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    46
by (dtac sym 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    47
by (asm_simp_tac (simpset() addsimps [fun_upd_idem_iff]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    48
qed "lift_act_Id";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    49
Addsimps [lift_act_Id];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    50
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    51
(*For compatibility with the original definition and perhaps simpler proofs*)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    52
Goalw [lift_act_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    53
    "((f,f') : lift_act i act) = (EX s'. f' = f(i := s') & (f i, s') : act)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    54
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    55
by (rtac exI 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    56
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    57
qed "lift_act_eq";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    58
AddIffs [lift_act_eq];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    59
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    60
Goalw [drop_act_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    61
     "[| (s, s') : act;  s : C |] ==> (s i, s' i) : drop_act C i act";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    62
by Auto_tac;
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    63
qed "drop_act_I";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    64
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    65
Goalw [drop_set_def, drop_act_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    66
     "UNIV <= drop_set i C ==> drop_act C i Id = Id";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    67
by (Blast_tac 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    68
qed "drop_act_Id";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    69
Addsimps [drop_act_Id];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    70
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    71
(** lift_prog and drop_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    72
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    73
Goalw [lift_prog_def] "Init (lift_prog i F) = lift_set i (Init F)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    74
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    75
qed "Init_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    76
Addsimps [Init_lift_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    77
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    78
Goalw [lift_prog_def] "Acts (lift_prog i F) = lift_act i `` Acts F";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    79
by (auto_tac (claset() addIs [Id_in_Acts RSN (2,image_eqI)], simpset()));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    80
qed "Acts_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    81
Addsimps [Acts_lift_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    82
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    83
Goalw [drop_prog_def] "Init (drop_prog C i F) = drop_set i (Init F)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    84
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    85
qed "Init_drop_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    86
Addsimps [Init_drop_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    87
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    88
Goal "Acts (drop_prog C i F) = insert Id (drop_act C i `` Acts F)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    89
by (auto_tac (claset() addIs [Id_in_Acts RSN (2,image_eqI)], 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    90
	      simpset() addsimps [drop_prog_def]));
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    91
qed "Acts_drop_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    92
Addsimps [Acts_drop_prog];
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    93
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    94
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    95
(*** sub ***)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    96
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    97
Addsimps [sub_def];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    98
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
    99
Goal "lift_set i {s. P s} = {s. P (sub i s)}";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   100
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   101
qed "lift_set_sub";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   102
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   103
Goal "{s. P (s i)} = lift_set i {s. P s}";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   104
by (asm_simp_tac (simpset() addsimps [lift_set_def]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   105
qed "Collect_eq_lift_set";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   106
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   107
Goal "sub i -`` A = lift_set i A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   108
by (Force_tac 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   109
qed "sub_vimage";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   110
Addsimps [sub_vimage];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   111
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   112
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   113
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   114
(*** lift_prog and the lattice operations ***)
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   115
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   116
Goal "lift_prog i SKIP = SKIP";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   117
by (auto_tac (claset() addSIs [program_equalityI],
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   118
	      simpset() addsimps [SKIP_def, lift_prog_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   119
qed "lift_prog_SKIP";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   120
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   121
Goal "lift_prog i (F Join G) = (lift_prog i F) Join (lift_prog i G)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   122
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7525
diff changeset
   123
by Auto_tac;
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   124
qed "lift_prog_Join";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   125
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   126
Goal "lift_prog i (JOIN J F) = (JN j:J. lift_prog i (F j))";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   127
by (rtac program_equalityI 1);
7537
875754b599df working snapshot
paulson
parents: 7525
diff changeset
   128
by Auto_tac;
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   129
qed "lift_prog_JN";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   130
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   131
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   132
(*** Equivalence with "extend" version ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   133
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   134
Goalw [lift_map_def] "good_map (lift_map i)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   135
by (rtac good_mapI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   136
by (res_inst_tac [("f", "%f. (f i, f)")] surjI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   137
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   138
by (dres_inst_tac [("f", "%f. f i")] arg_cong 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   139
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   140
qed "good_map_lift_map";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   141
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   142
fun lift_export th = good_map_lift_map RS export th;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   143
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   144
Goal "fst (inv (lift_map i) g) = g i";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   145
by (rtac (good_map_lift_map RS good_map_is_surj RS fst_inv_equalityI) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   146
by (auto_tac (claset(), simpset() addsimps [lift_map_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   147
qed "fst_inv_lift_map";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   148
Addsimps [fst_inv_lift_map];
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   149
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   150
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   151
Goal "lift_set i A = extend_set (lift_map i) A";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   152
by (auto_tac (claset(), 
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   153
     simpset() addsimps [lift_export mem_extend_set_iff]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   154
qed "lift_set_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   155
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   156
Goalw [drop_set_def, project_set_def, lift_map_def]
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   157
     "drop_set i A = project_set (lift_map i) A";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   158
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   159
by (rtac image_eqI 2);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   160
by (rtac exI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   161
by (stac (refl RS fun_upd_idem) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   162
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   163
qed "drop_set_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   164
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   165
Goal "lift_act i = extend_act (lift_map i)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   166
by (rtac ext 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   167
by Auto_tac;
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   168
by (forward_tac [lift_export extend_act_D] 2);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   169
by (auto_tac (claset(), simpset() addsimps [extend_act_def]));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   170
by (auto_tac (claset(), simpset() addsimps [extend_act_def, lift_map_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   171
by (rtac bexI 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   172
by (auto_tac (claset() addSIs [exI], simpset()));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   173
qed "lift_act_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   174
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   175
Goal "drop_act C i = project_act C (lift_map i)";
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   176
by (rtac ext 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   177
by (rewrite_goals_tac [project_act_def, drop_act_def, lift_map_def]);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   178
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   179
by (REPEAT_FIRST (ares_tac [exI, conjI]));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   180
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   181
by (REPEAT_FIRST (assume_tac ORELSE' stac (refl RS fun_upd_idem)));
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   182
qed "drop_act_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   183
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   184
Goal "lift_prog i = extend (lift_map i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   185
by (rtac (program_equalityI RS ext) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   186
by (simp_tac (simpset() addsimps [lift_set_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   187
by (simp_tac (simpset() 
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   188
	      addsimps [lift_export Acts_extend, 
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   189
			lift_act_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   190
qed "lift_prog_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   191
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   192
Goal "drop_prog C i = project C (lift_map i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   193
by (rtac (program_equalityI RS ext) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   194
by (simp_tac (simpset() addsimps [drop_set_correct]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   195
by (simp_tac (simpset() 
7547
a72a551b6d79 new proof of drop_prog_correct for new definition of project_act
paulson
parents: 7537
diff changeset
   196
	      addsimps [Acts_project, drop_act_correct]) 1);
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   197
qed "drop_prog_correct";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   198
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   199
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   200
(** Injectivity of lift_set, lift_act, lift_prog **)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   201
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   202
Goalw [lift_set_def, drop_set_def] "drop_set i (lift_set i F) = F";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   203
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   204
qed "lift_set_inverse";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   205
Addsimps [lift_set_inverse];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   206
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   207
Goal "inj (lift_set i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   208
by (rtac inj_on_inverseI 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   209
by (rtac lift_set_inverse 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   210
qed "inj_lift_set";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   211
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   212
(*Because A and B could differ outside i, cannot generalize result to 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   213
   drop_set i (A Int B) = drop_set i A Int drop_set i B
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   214
*)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   215
Goalw [lift_set_def, drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   216
     "drop_set i ((lift_set i A) Int B) = A Int (drop_set i B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   217
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   218
qed "drop_set_Int_lift_set";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   219
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   220
Goalw [lift_set_def, drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   221
     "drop_set i (B Int (lift_set i A)) = (drop_set i B) Int A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   222
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   223
qed "drop_set_Int_lift_set2";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   224
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   225
Goalw [drop_set_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   226
     "i : I ==> drop_set i (INT j:I. lift_set j A) = A";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   227
by Auto_tac;
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   228
qed "drop_set_INT";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   229
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   230
Goal "lift_set i UNIV = UNIV";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   231
by (simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   232
    (simpset() addsimps [lift_set_correct, lift_export extend_set_UNIV_eq]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   233
qed "lift_set_UNIV_eq";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   234
Addsimps [lift_set_UNIV_eq];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   235
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   236
Goal "Domain act <= drop_set i C ==> drop_act C i (lift_act i act) = act";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   237
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   238
    (simpset() addsimps [drop_set_correct, drop_act_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   239
			 lift_act_correct, lift_export extend_act_inverse]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   240
qed "lift_act_inverse";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   241
Addsimps [lift_act_inverse];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   242
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   243
Goal "UNIV <= drop_set i C ==> drop_prog C i (lift_prog i F) = F";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   244
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   245
    (simpset() addsimps [drop_set_correct, drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   246
			 lift_prog_correct, lift_export extend_inverse]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   247
qed "lift_prog_inverse";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   248
Addsimps [lift_prog_inverse];
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   249
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   250
Goal "inj (lift_prog i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   251
by (simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   252
    (simpset() addsimps [lift_prog_correct, lift_export inj_extend]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   253
qed "inj_lift_prog";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   254
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   255
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   256
(*** More Lemmas ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   257
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   258
Goal "lift_act i act ^^ lift_set i A = lift_set i (act^^A)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   259
by (asm_simp_tac (simpset() addsimps [lift_set_correct, lift_act_correct,
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   260
				      lift_export extend_act_Image]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   261
qed "lift_act_Image";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   262
Addsimps [lift_act_Image];
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   263
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   264
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   265
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   266
(*** Safety: co, stable, invariant ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   267
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   268
(** Safety and lift_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   269
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   270
Goal "(lift_prog i F : (lift_set i A) co (lift_set i B))  =  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   271
\     (F : A co B)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   272
by (auto_tac (claset(), 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   273
	      simpset() addsimps [constrains_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   274
by (Force_tac 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   275
qed "lift_prog_constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   276
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   277
Goal "(lift_prog i F : stable (lift_set i A)) = (F : stable A)";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   278
by (simp_tac (simpset() addsimps [stable_def, lift_prog_constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   279
qed "lift_prog_stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   280
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   281
Goal "(lift_prog i F : invariant (lift_set i A)) = (F : invariant A)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   282
by (auto_tac (claset(),
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   283
	      simpset() addsimps [invariant_def, lift_prog_stable]));
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   284
qed "lift_prog_invariant";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   285
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   286
(*This one looks strange!  Proof probably is by case analysis on i=j.
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   287
  If i~=j then lift_prog j (F j) does nothing to lift_set i, and the 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   288
  premise ensures A<=B.*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   289
Goal "F i : A co B  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   290
\     ==> lift_prog j (F j) : (lift_set i A) co (lift_set i B)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   291
by (auto_tac (claset(), 
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   292
	      simpset() addsimps [constrains_def]));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   293
by (REPEAT (Blast_tac 1));
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   294
qed "constrains_imp_lift_prog_constrains";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   295
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   296
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   297
(** Safety and drop_prog **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   298
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   299
Goal "(drop_prog C i F : A co B)  =  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   300
\     (F : (C Int lift_set i A) co (lift_set i B) & A <= B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   301
by (simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   302
    (simpset() addsimps [drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   303
			 lift_set_correct, lift_export project_constrains]) 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   304
qed "drop_prog_constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   305
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   306
Goal "(drop_prog UNIV i F : stable A)  =  (F : stable (lift_set i A))";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   307
by (simp_tac (simpset() addsimps [stable_def, drop_prog_constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   308
qed "drop_prog_stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   309
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   310
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   311
(*** Diff, needed for localTo ***)
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   312
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   313
Goal "[| (UN act:acts. Domain act) <= drop_set i C; \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   314
\        Diff G (lift_act i `` acts) : (lift_set i A) co (lift_set i B) |]  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   315
\     ==> Diff (drop_prog C i G) acts : A co B";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   316
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   317
    (simpset() addsimps [drop_set_correct, drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   318
			 lift_set_correct, lift_act_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   319
			 lift_export Diff_project_co]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   320
qed "Diff_drop_prog_co";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   321
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   322
Goalw [stable_def]
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   323
     "[| (UN act:acts. Domain act) <= drop_set i C; \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   324
\        Diff G (lift_act i `` acts) : stable (lift_set i A) |]  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   325
\     ==> Diff (drop_prog C i G) acts : stable A";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   326
by (etac Diff_drop_prog_co 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   327
by (assume_tac 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   328
qed "Diff_drop_prog_stable";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   329
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   330
Goalw [constrains_def, Diff_def]
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   331
     "Diff G acts : A co B  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   332
\     ==> Diff (lift_prog i G) (lift_act i `` acts) \
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   333
\         : (lift_set i A) co (lift_set i B)";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   334
by Auto_tac;
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   335
by (Blast_tac 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   336
qed "Diff_lift_prog_co";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   337
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   338
Goalw [stable_def]
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   339
     "Diff G acts : stable A  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   340
\     ==> Diff (lift_prog i G) (lift_act i `` acts) : stable (lift_set i A)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   341
by (etac Diff_lift_prog_co 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   342
qed "Diff_lift_prog_stable";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   343
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   344
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   345
(*** Weak safety primitives: Co, Stable ***)
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   346
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   347
(** Reachability **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   348
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   349
Goal "reachable (lift_prog i F) = lift_set i (reachable F)";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   350
by (simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   351
    (simpset() addsimps [lift_prog_correct, lift_set_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   352
			 lift_export reachable_extend_eq]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   353
qed "reachable_lift_prog";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   354
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   355
Goal "(lift_prog i F : (lift_set i A) Co (lift_set i B))  =  \
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   356
\     (F : A Co B)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   357
by (simp_tac (simpset() addsimps [Constrains_def, reachable_lift_prog,
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   358
				  lift_prog_constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   359
qed "lift_prog_Constrains";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   360
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   361
Goal "(lift_prog i F : Stable (lift_set i A)) = (F : Stable A)";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   362
by (simp_tac (simpset() addsimps [Stable_def, lift_prog_Constrains]) 1);
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   363
qed "lift_prog_Stable";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   364
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   365
Goal "[| reachable (lift_prog i F Join G) <= C;    \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   366
\        F Join drop_prog C i G : A Co B |] \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   367
\     ==> lift_prog i F Join G : (lift_set i A) Co (lift_set i B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   368
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   369
    (simpset() addsimps [lift_prog_correct, drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   370
		     lift_set_correct, lift_export project_Constrains_D]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   371
qed "drop_prog_Constrains_D";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   372
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   373
Goalw [Stable_def]
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   374
     "[| reachable (lift_prog i F Join G) <= C;    \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   375
\        F Join drop_prog C i G : Stable A |]  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   376
\     ==> lift_prog i F Join G : Stable (lift_set i A)";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   377
by (asm_simp_tac (simpset() addsimps [drop_prog_Constrains_D]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   378
qed "drop_prog_Stable_D";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   379
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   380
Goal "[| reachable (lift_prog i F Join G) <= C;  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   381
\        F Join drop_prog C i G : Always A |]   \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   382
\     ==> lift_prog i F Join G : Always (lift_set i A)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   383
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   384
    (simpset() addsimps [lift_prog_correct, drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   385
		     lift_set_correct, lift_export project_Always_D]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   386
qed "drop_prog_Always_D";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   387
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   388
Goalw [Increasing_def]
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   389
     "[| reachable (lift_prog i F Join G) <= C;  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   390
\        F Join drop_prog C i G : Increasing func |] \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   391
\     ==> lift_prog i F Join G : Increasing (func o (sub i))";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   392
by Auto_tac;
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   393
by (stac Collect_eq_lift_set 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   394
by (asm_simp_tac (simpset() addsimps [drop_prog_Stable_D]) 1); 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   395
qed "project_Increasing_D";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   396
7361
477e1bdf230f changed "guar" back to "guarantees" (sorry)
paulson
parents: 7343
diff changeset
   397
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   398
(*UNUSED*)
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   399
Goal "UNIV <= drop_set i C \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   400
\     ==> drop_prog C i ((lift_prog i F) Join G) = F Join (drop_prog C i G)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   401
by (asm_full_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   402
    (simpset() addsimps [lift_prog_correct, drop_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   403
		     drop_set_correct, lift_export project_extend_Join]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   404
qed "drop_prog_lift_prog_Join";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   405
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   406
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   407
(*** Progress: transient, ensures ***)
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   408
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   409
Goal "(lift_prog i F : transient (lift_set i A)) = (F : transient A)";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   410
by (simp_tac (simpset() addsimps [lift_set_correct, lift_prog_correct,
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   411
			  lift_export extend_transient]) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   412
qed "lift_prog_transient";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   413
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   414
Goal "(lift_prog i F : transient (lift_set j A)) = \
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   415
\     (i=j & F : transient A | A={})";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   416
by (case_tac "i=j" 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   417
by (auto_tac (claset(), simpset() addsimps [lift_prog_transient]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   418
by (auto_tac (claset(), simpset() addsimps [lift_prog_def, transient_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   419
by (Force_tac 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   420
qed "lift_prog_transient_eq_disj";
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   421
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   422
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   423
(*** guarantees properties ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   424
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   425
val [xguary,project,lift_prog] =
7361
477e1bdf230f changed "guar" back to "guarantees" (sorry)
paulson
parents: 7343
diff changeset
   426
Goal "[| F : X guarantees Y;  \
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   427
\        !!G. lift_prog i F Join G : X' ==> F Join proj G : X;  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   428
\        !!G. [| F Join proj G : Y; lift_prog i F Join G : X'; \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   429
\                Disjoint (lift_prog i F) G |] \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   430
\             ==> lift_prog i F Join G : Y' |] \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   431
\     ==> lift_prog i F : X' guarantees Y'";
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   432
by (rtac (xguary RS guaranteesD RS lift_prog RS guaranteesI) 1);
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   433
by (etac project 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   434
by (assume_tac 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   435
by (assume_tac 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   436
qed "drop_prog_guarantees";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   437
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   438
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   439
(** Are these two useful?? **)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   440
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   441
(*The other direction fails: having FF : Stable {s. z <= f (s i)} does not
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   442
  ensure that F has the form lift_prog i F for some F.*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   443
Goal "lift_prog i `` Stable {s. P (f s)} <= Stable {s. P (f (s i))}";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   444
by Auto_tac;
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   445
by (stac Collect_eq_lift_set 1); 
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   446
by (asm_simp_tac (simpset() addsimps [lift_prog_Stable]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   447
qed "image_lift_prog_Stable";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   448
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   449
Goal "lift_prog i `` Increasing f <= Increasing (f o sub i)";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   450
by (simp_tac (simpset() addsimps [Increasing_def,
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   451
				  inj_lift_prog RS image_INT]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   452
by (blast_tac (claset() addIs [impOfSubs image_lift_prog_Stable]) 1);
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   453
qed "image_lift_prog_Increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   454
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   455
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   456
(*** guarantees corollaries ***)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   457
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   458
Goal "F : UNIV guarantees increasing f \
7361
477e1bdf230f changed "guar" back to "guarantees" (sorry)
paulson
parents: 7343
diff changeset
   459
\     ==> lift_prog i F : UNIV guarantees increasing (f o sub i)";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   460
by (dtac (lift_export extend_guar_increasing) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   461
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   462
qed "lift_prog_guar_increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   463
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   464
Goal "F : UNIV guarantees Increasing f \
7361
477e1bdf230f changed "guar" back to "guarantees" (sorry)
paulson
parents: 7343
diff changeset
   465
\     ==> lift_prog i F : UNIV guarantees Increasing (f o sub i)";
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   466
by (dtac (lift_export extend_guar_Increasing) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   467
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   468
qed "lift_prog_guar_Increasing";
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   469
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   470
Goal "F : (v localTo G) guarantees increasing func  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   471
\     ==> lift_prog i F : (v o sub i) localTo (lift_prog i G)  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   472
\                         guarantees increasing (func o sub i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   473
by (dtac (lift_export extend_localTo_guar_increasing) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   474
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   475
qed "lift_prog_localTo_guar_increasing";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   476
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   477
Goal "F : (v localTo G) guarantees Increasing func  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   478
\     ==> lift_prog i F : (v o sub i) localTo (lift_prog i G)  \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   479
\                         guarantees Increasing (func o sub i)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   480
by (dtac (lift_export extend_localTo_guar_Increasing) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   481
by (asm_full_simp_tac (simpset() addsimps [lift_prog_correct, o_def]) 1);
7343
4fa705cedbdb renamed some theorems; also better natural deduction style for old ones
paulson
parents: 7186
diff changeset
   482
qed "lift_prog_localTo_guar_Increasing";
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
   483
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   484
Goal "F : Always A guarantees Always B \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   485
\ ==> lift_prog i F : Always(lift_set i A) guarantees Always (lift_set i B)";
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   486
by (asm_simp_tac
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   487
    (simpset() addsimps [lift_set_correct, lift_prog_correct, 
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   488
			 lift_export extend_guar_Always]) 1);
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   489
qed "lift_prog_guar_Always";
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   490
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   491
(*No analogue of this in Extend.ML!*)
7688
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   492
Goal "[| lift_prog i F : A co B |] \
d106cad8f515 most results now refer to those for "extend"
paulson
parents: 7547
diff changeset
   493
\     ==> F : (drop_set i A) co (drop_set i B)";
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
   494
by (auto_tac (claset(), 
7525
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   495
	      simpset() addsimps [constrains_def, drop_set_def]));
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   496
by (force_tac (claset() addSIs [image_eqI'], simpset()) 1);
2a75abcf30e0 more rational theorem names (?)
paulson
parents: 7499
diff changeset
   497
qed "lift_prog_constrains_drop_set";