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