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