src/HOL/UNITY/Union.ML
author paulson
Mon Oct 11 10:53:39 1999 +0200 (1999-10-11)
changeset 7826 c6a8b73b6c2a
parent 7689 affe0c2fdfbf
child 7878 43b03d412b82
permissions -rw-r--r--
working shapshot with "projecting" and "extending"
paulson@5252
     1
(*  Title:      HOL/UNITY/Union.ML
paulson@5252
     2
    ID:         $Id$
paulson@5252
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@5252
     4
    Copyright   1998  University of Cambridge
paulson@5252
     5
paulson@5252
     6
Unions of programs
paulson@5252
     7
paulson@5252
     8
From Misra's Chapter 5: Asynchronous Compositions of Programs
paulson@5252
     9
*)
paulson@5252
    10
paulson@6012
    11
Addcongs [UN_cong, INT_cong];
paulson@5252
    12
paulson@6295
    13
paulson@5867
    14
(** SKIP **)
paulson@5867
    15
paulson@6295
    16
Goal "Init SKIP = UNIV";
paulson@5648
    17
by (simp_tac (simpset() addsimps [SKIP_def]) 1);
paulson@5611
    18
qed "Init_SKIP";
paulson@5611
    19
paulson@6295
    20
Goal "Acts SKIP = {Id}";
paulson@5648
    21
by (simp_tac (simpset() addsimps [SKIP_def]) 1);
paulson@5648
    22
qed "Acts_SKIP";
paulson@5648
    23
paulson@6295
    24
Addsimps [Init_SKIP, Acts_SKIP];
paulson@5648
    25
paulson@6295
    26
Goal "reachable SKIP = UNIV";
paulson@6012
    27
by (force_tac (claset() addEs [reachable.induct]
paulson@6012
    28
			addIs reachable.intrs, simpset()) 1);
paulson@5867
    29
qed "reachable_SKIP";
paulson@5867
    30
paulson@5867
    31
Addsimps [reachable_SKIP];
paulson@5867
    32
paulson@6836
    33
(** SKIP and safety properties **)
paulson@6836
    34
paulson@6836
    35
Goalw [constrains_def] "(SKIP : A co B) = (A<=B)";
paulson@6836
    36
by Auto_tac;
paulson@6836
    37
qed "SKIP_in_constrains_iff";
paulson@6836
    38
AddIffs [SKIP_in_constrains_iff];
paulson@6836
    39
paulson@6836
    40
Goalw [Constrains_def] "(SKIP : A Co B) = (A<=B)";
paulson@6836
    41
by Auto_tac;
paulson@6836
    42
qed "SKIP_in_Constrains_iff";
paulson@6836
    43
AddIffs [SKIP_in_Constrains_iff];
paulson@6836
    44
paulson@6836
    45
Goalw [stable_def] "SKIP : stable A";
paulson@6836
    46
by Auto_tac;
paulson@6836
    47
qed "SKIP_in_stable";
paulson@6836
    48
AddIffs [SKIP_in_stable, SKIP_in_stable RS stable_imp_Stable];
paulson@6836
    49
paulson@5867
    50
paulson@6012
    51
(** Join **)
paulson@6012
    52
paulson@6295
    53
Goal "Init (F Join G) = Init F Int Init G";
paulson@6012
    54
by (simp_tac (simpset() addsimps [Join_def]) 1);
paulson@5313
    55
qed "Init_Join";
paulson@5252
    56
paulson@6295
    57
Goal "Acts (F Join G) = Acts F Un Acts G";
paulson@5596
    58
by (auto_tac (claset(), simpset() addsimps [Join_def]));
paulson@5313
    59
qed "Acts_Join";
paulson@5252
    60
paulson@7537
    61
Addsimps [Init_Join, Acts_Join];
paulson@6295
    62
paulson@6012
    63
paulson@6012
    64
(** JN **)
paulson@6012
    65
paulson@6295
    66
Goalw [JOIN_def, SKIP_def] "(JN i:{}. F i) = SKIP";
paulson@6012
    67
by Auto_tac;
paulson@6012
    68
qed "JN_empty";
paulson@6012
    69
Addsimps [JN_empty];
paulson@6012
    70
paulson@6633
    71
Goal "(JN i:insert a I. F i) = (F a) Join (JN i:I. F i)";
paulson@6295
    72
by (rtac program_equalityI 1);
paulson@6295
    73
by (ALLGOALS (simp_tac (simpset() addsimps [JOIN_def, Join_def])));
paulson@6295
    74
qed "JN_insert";
paulson@6295
    75
Addsimps[JN_empty, JN_insert];
paulson@6012
    76
paulson@5611
    77
Goal "Init (JN i:I. F i) = (INT i:I. Init (F i))";
paulson@6295
    78
by (simp_tac (simpset() addsimps [JOIN_def]) 1);
paulson@5313
    79
qed "Init_JN";
paulson@5252
    80
paulson@6295
    81
Goal "Acts (JN i:I. F i) = insert Id (UN i:I. Acts (F i))";
paulson@5596
    82
by (auto_tac (claset(), simpset() addsimps [JOIN_def]));
paulson@5313
    83
qed "Acts_JN";
paulson@5252
    84
paulson@7537
    85
Addsimps [Init_JN, Acts_JN];
paulson@5867
    86
paulson@6295
    87
val prems = Goalw [JOIN_def]
paulson@6633
    88
    "[| I=J;  !!i. i:J ==> F i = G i |] ==> \
paulson@6633
    89
\    (JN i:I. F i) = (JN i:J. G i)";
paulson@6295
    90
by (asm_simp_tac (simpset() addsimps prems) 1);
paulson@6295
    91
qed "JN_cong";
paulson@6012
    92
paulson@6295
    93
Addcongs [JN_cong];
paulson@5584
    94
paulson@5584
    95
paulson@5611
    96
(** Algebraic laws **)
paulson@5259
    97
paulson@5611
    98
Goal "F Join G = G Join F";
paulson@5313
    99
by (simp_tac (simpset() addsimps [Join_def, Un_commute, Int_commute]) 1);
paulson@5259
   100
qed "Join_commute";
paulson@5259
   101
paulson@7360
   102
Goal "A Join (B Join C) = B Join (A Join C)";
paulson@7360
   103
by (simp_tac (simpset() addsimps Un_ac@Int_ac@[Join_def]) 1);
paulson@7360
   104
qed "Join_left_commute";
paulson@7360
   105
paulson@5611
   106
Goal "(F Join G) Join H = F Join (G Join H)";
paulson@6295
   107
by (simp_tac (simpset() addsimps Un_ac@[Join_def, Int_assoc]) 1);
paulson@5259
   108
qed "Join_assoc";
paulson@5596
   109
 
paulson@6295
   110
Goalw [Join_def, SKIP_def] "SKIP Join F = F";
paulson@5611
   111
by (rtac program_equalityI 1);
paulson@6295
   112
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb])));
paulson@5611
   113
qed "Join_SKIP_left";
paulson@5584
   114
paulson@6295
   115
Goalw [Join_def, SKIP_def] "F Join SKIP = F";
paulson@6295
   116
by (rtac program_equalityI 1);
paulson@6295
   117
by (ALLGOALS (simp_tac (simpset() addsimps [insert_absorb])));
paulson@5611
   118
qed "Join_SKIP_right";
paulson@5611
   119
paulson@5611
   120
Addsimps [Join_SKIP_left, Join_SKIP_right];
paulson@5611
   121
paulson@5611
   122
Goalw [Join_def] "F Join F = F";
paulson@5611
   123
by (rtac program_equalityI 1);
paulson@6295
   124
by Auto_tac;
paulson@5313
   125
qed "Join_absorb";
paulson@5313
   126
paulson@5611
   127
Addsimps [Join_absorb];
paulson@5313
   128
paulson@7360
   129
Goalw [Join_def] "A Join (A Join B) = A Join B";
paulson@7360
   130
by (rtac program_equalityI 1);
paulson@7360
   131
by Auto_tac;
paulson@7360
   132
qed "Join_left_absorb";
paulson@7360
   133
paulson@7360
   134
(*Join is an AC-operator*)
paulson@7360
   135
val Join_ac = [Join_assoc, Join_left_absorb, Join_commute, Join_left_commute];
paulson@6295
   136
paulson@6295
   137
paulson@6295
   138
(*** JN laws ***)
paulson@6295
   139
paulson@6633
   140
(*Also follows by JN_insert and insert_absorb, but the proof is longer*)
paulson@6633
   141
Goal "k:I ==> F k Join (JN i:I. F i) = (JN i:I. F i)";
paulson@7537
   142
by (auto_tac (claset() addSIs [program_equalityI], simpset()));
paulson@6295
   143
qed "JN_absorb";
paulson@6295
   144
paulson@6633
   145
Goal "(JN i: I Un J. F i) = ((JN i: I. F i) Join (JN i:J. F i))";
paulson@7537
   146
by (auto_tac (claset() addSIs [program_equalityI], simpset()));
paulson@6633
   147
qed "JN_Un";
paulson@5970
   148
paulson@6836
   149
Goal "(JN i:I. c) = (if I={} then SKIP else c)";
paulson@7537
   150
by (auto_tac (claset() addSIs [program_equalityI], simpset()));
paulson@5970
   151
qed "JN_constant";
paulson@5970
   152
paulson@6633
   153
Goal "(JN i:I. F i Join G i) = (JN i:I. F i)  Join  (JN i:I. G i)";
paulson@7537
   154
by (auto_tac (claset() addSIs [program_equalityI], simpset()));
paulson@5970
   155
qed "JN_Join_distrib";
paulson@5584
   156
paulson@6633
   157
Goal "i : I ==> (JN i:I. F i Join G) = ((JN i:I. F i) Join G)";
paulson@6633
   158
by (asm_simp_tac (simpset() addsimps [JN_Join_distrib, JN_constant]) 1);
paulson@6836
   159
by Auto_tac;
paulson@6633
   160
qed "JN_Join_miniscope";
paulson@6633
   161
paulson@5584
   162
paulson@6536
   163
(*** Safety: co, stable, FP ***)
paulson@5313
   164
paulson@6633
   165
(*Fails if I={} because it collapses to SKIP : A co B*)
paulson@6295
   166
Goalw [constrains_def, JOIN_def]
paulson@6633
   167
    "i : I ==> (JN i:I. F i) : A co B = (ALL i:I. F i : A co B)";
paulson@6295
   168
by (Simp_tac 1);
paulson@6295
   169
by (Blast_tac 1);
paulson@7523
   170
qed "JN_constrains";
paulson@5313
   171
paulson@6633
   172
Goal "(F Join G : A co B) = (F : A co B & G : A co B)";
paulson@6295
   173
by (auto_tac
paulson@6295
   174
    (claset(),
paulson@6295
   175
     simpset() addsimps [constrains_def, Join_def]));
paulson@7523
   176
qed "Join_constrains";
paulson@5620
   177
paulson@6633
   178
(*Analogous weak versions FAIL; see Misra [1994] 5.4.1, Substitution Axiom.
paulson@6633
   179
  reachable (F Join G) could be much bigger than reachable F, reachable G
paulson@6633
   180
*)
paulson@6012
   181
paulson@6295
   182
paulson@6536
   183
Goal "[| F : A co A';  G : B co B' |] \
paulson@6536
   184
\     ==> F Join G : (A Int B) co (A' Un B')";
paulson@7523
   185
by (simp_tac (simpset() addsimps [Join_constrains]) 1);
paulson@5313
   186
by (blast_tac (claset() addIs [constrains_weaken]) 1);
paulson@7523
   187
qed "Join_constrains_weaken";
paulson@5313
   188
paulson@6633
   189
Goal "[| ALL i:I. F i : A i co A' i;  i: I |] \
paulson@6633
   190
\     ==> (JN i:I. F i) : (INT i:I. A i) co (UN i:I. A' i)";
paulson@7523
   191
by (asm_simp_tac (simpset() addsimps [JN_constrains]) 1);
paulson@6633
   192
by (blast_tac (claset() addIs [constrains_weaken]) 1);
paulson@7523
   193
qed "JN_constrains_weaken";
paulson@6633
   194
paulson@6295
   195
Goal "i : I ==> \
paulson@6295
   196
\     (JN i:I. F i) : stable A = (ALL i:I. F i : stable A)";
paulson@7523
   197
by (asm_simp_tac (simpset() addsimps [stable_def, JN_constrains]) 1);
paulson@7523
   198
qed "JN_stable";
paulson@5313
   199
paulson@6295
   200
Goal "[| ALL i:I. F i : invariant A;  i : I |]  \
paulson@5970
   201
\      ==> (JN i:I. F i) : invariant A";
paulson@7523
   202
by (asm_full_simp_tac (simpset() addsimps [invariant_def, JN_stable]) 1);
paulson@5970
   203
by (Blast_tac 1);
paulson@5970
   204
bind_thm ("invariant_JN_I", ballI RS result());
paulson@5970
   205
paulson@7594
   206
Goal "(F Join G : stable A) = \
paulson@6295
   207
\     (F : stable A & G : stable A)";
paulson@7523
   208
by (simp_tac (simpset() addsimps [stable_def, Join_constrains]) 1);
paulson@7523
   209
qed "Join_stable";
paulson@5313
   210
paulson@7594
   211
Goal "(F Join G : increasing f) = \
paulson@7594
   212
\     (F : increasing f & G : increasing f)";
paulson@7594
   213
by (simp_tac (simpset() addsimps [increasing_def, Join_stable]) 1);
paulson@7594
   214
by (Blast_tac 1);
paulson@7594
   215
qed "Join_increasing";
paulson@7594
   216
paulson@6295
   217
Goal "[| F : invariant A; G : invariant A |]  \
paulson@5970
   218
\     ==> F Join G : invariant A";
paulson@7523
   219
by (full_simp_tac (simpset() addsimps [invariant_def, Join_stable]) 1);
paulson@5970
   220
by (Blast_tac 1);
paulson@5970
   221
qed "invariant_JoinI";
paulson@5970
   222
paulson@6295
   223
Goal "i : I ==> FP (JN i:I. F i) = (INT i:I. FP (F i))";
paulson@7523
   224
by (asm_simp_tac (simpset() addsimps [FP_def, JN_stable, INTER_def]) 1);
paulson@5313
   225
qed "FP_JN";
paulson@5313
   226
paulson@5313
   227
paulson@5313
   228
(*** Progress: transient, ensures ***)
paulson@5313
   229
paulson@6295
   230
Goal "i : I ==> \
paulson@6295
   231
\   (JN i:I. F i) : transient A = (EX i:I. F i : transient A)";
paulson@6295
   232
by (auto_tac (claset(),
paulson@6295
   233
	      simpset() addsimps [transient_def, JOIN_def]));
paulson@7523
   234
qed "JN_transient";
paulson@5313
   235
paulson@6295
   236
Goal "F Join G : transient A = \
paulson@6295
   237
\     (F : transient A | G : transient A)";
paulson@6295
   238
by (auto_tac (claset(),
paulson@6295
   239
	      simpset() addsimps [bex_Un, transient_def,
paulson@6295
   240
				  Join_def]));
paulson@7523
   241
qed "Join_transient";
paulson@5313
   242
paulson@6295
   243
Goal "i : I ==> \
paulson@6536
   244
\     (JN i:I. F i) : A ensures B = \
paulson@6536
   245
\     ((ALL i:I. F i : (A-B) co (A Un B)) & \
paulson@6536
   246
\      (EX i:I. F i : A ensures B))";
paulson@5313
   247
by (auto_tac (claset(),
paulson@7523
   248
	      simpset() addsimps [ensures_def, JN_constrains, JN_transient]));
paulson@7523
   249
qed "JN_ensures";
paulson@5313
   250
paulson@5313
   251
Goalw [ensures_def]
paulson@6536
   252
     "F Join G : A ensures B =     \
paulson@7630
   253
\     (F : (A-B) co (A Un B) & G : (A-B) co (A Un B) & \
paulson@7630
   254
\      (F : transient (A-B) | G : transient (A-B)))";
paulson@5313
   255
by (auto_tac (claset(),
paulson@7523
   256
	      simpset() addsimps [Join_constrains, Join_transient]));
paulson@7523
   257
qed "Join_ensures";
paulson@5313
   258
paulson@6295
   259
Goalw [stable_def, constrains_def, Join_def]
paulson@6536
   260
    "[| F : stable A;  G : A co A' |] \
paulson@6536
   261
\    ==> F Join G : A co A'";
paulson@6295
   262
by (asm_full_simp_tac (simpset() addsimps [ball_Un]) 1);
paulson@5313
   263
by (Blast_tac 1);
paulson@7523
   264
qed "stable_Join_constrains";
paulson@5313
   265
paulson@6633
   266
(*Premise for G cannot use Always because  F: Stable A  is weaker than
paulson@5648
   267
  G : stable A *)
paulson@6570
   268
Goal "[| F : stable A;  G : invariant A |] ==> F Join G : Always A";
paulson@6570
   269
by (full_simp_tac (simpset() addsimps [Always_def, invariant_def, 
paulson@7523
   270
				       Stable_eq_stable, Join_stable]) 1);
paulson@5313
   271
by (force_tac(claset() addIs [stable_reachable, stable_Int],
paulson@7537
   272
	      simpset()) 1);
paulson@6570
   273
qed "stable_Join_Always";
paulson@5313
   274
paulson@6536
   275
Goal "[| F : stable A;  G : A ensures B |] ==> F Join G : A ensures B";
paulson@7523
   276
by (asm_simp_tac (simpset() addsimps [Join_ensures]) 1);
paulson@5313
   277
by (asm_full_simp_tac (simpset() addsimps [stable_def, ensures_def]) 1);
paulson@5313
   278
by (etac constrains_weaken 1);
paulson@5313
   279
by Auto_tac;
paulson@7523
   280
qed "stable_Join_ensures1";
paulson@5313
   281
paulson@5313
   282
(*As above, but exchanging the roles of F and G*)
paulson@6536
   283
Goal "[| F : A ensures B;  G : stable A |] ==> F Join G : A ensures B";
paulson@5313
   284
by (stac Join_commute 1);
paulson@7523
   285
by (blast_tac (claset() addIs [stable_Join_ensures1]) 1);
paulson@7523
   286
qed "stable_Join_ensures2";
paulson@5313
   287
paulson@5648
   288
paulson@5804
   289
(** Diff and localTo **)
paulson@5804
   290
paulson@7594
   291
Goalw [Diff_def] "F Join (Diff G (Acts F)) = F Join G";
paulson@5804
   292
by (rtac program_equalityI 1);
paulson@6295
   293
by Auto_tac;
paulson@5804
   294
qed "Join_Diff2";
paulson@5804
   295
paulson@7594
   296
Goalw [Diff_def]
paulson@7594
   297
     "Diff (F Join G) (Acts H) = (Diff F (Acts H)) Join (Diff G (Acts H))";
paulson@7594
   298
by (rtac program_equalityI 1);
paulson@7594
   299
by Auto_tac;
paulson@7594
   300
qed "Diff_Join_distrib";
paulson@7594
   301
paulson@7594
   302
Goalw [Diff_def, constrains_def] "(Diff F (Acts F) : A co B) = (A <= B)";
paulson@7594
   303
by Auto_tac;
paulson@7594
   304
qed "Diff_self_constrains";
paulson@7594
   305
paulson@6295
   306
Goalw [Diff_def, Disjoint_def] "Disjoint F (Diff G (Acts F))";
paulson@5804
   307
by Auto_tac;
paulson@5804
   308
qed "Diff_Disjoint";
paulson@5648
   309
paulson@7826
   310
Goal "[| G : v localTo F;  Disjoint F G |] ==> G : stable {s. v s = z}";
paulson@5648
   311
by (asm_full_simp_tac 
paulson@6295
   312
    (simpset() addsimps [localTo_def, Diff_def, Disjoint_def,
paulson@7537
   313
			 stable_def, constrains_def]) 1);
paulson@5804
   314
by (Blast_tac 1);
paulson@5804
   315
qed "localTo_imp_stable";
paulson@5804
   316
paulson@5804
   317
Goalw [localTo_def, stable_def, constrains_def]
paulson@5804
   318
     "v localTo F <= (f o v) localTo F";
paulson@5804
   319
by (Clarify_tac 1);
paulson@5898
   320
by (force_tac (claset() addSEs [allE, ballE], simpset()) 1);
paulson@5804
   321
qed "localTo_imp_o_localTo";
paulson@5804
   322
paulson@7689
   323
Goalw [localTo_def, stable_def, constrains_def]
paulson@7689
   324
     "(%s. x) localTo F = UNIV";
paulson@7689
   325
by (Blast_tac 1);
paulson@7689
   326
qed "triv_localTo_eq_UNIV";
paulson@7689
   327
paulson@7594
   328
Goal "(F Join G : v localTo H) = (F : v localTo H  &  G : v localTo H)";
paulson@7594
   329
by (asm_full_simp_tac 
paulson@7594
   330
    (simpset() addsimps [localTo_def, Diff_Join_distrib,
paulson@7594
   331
			 stable_def, Join_constrains]) 1);
paulson@7594
   332
by (Blast_tac 1);
paulson@7594
   333
qed "Join_localTo";
paulson@7594
   334
paulson@7594
   335
Goal "F : v localTo F";
paulson@7594
   336
by (simp_tac 
paulson@7594
   337
    (simpset() addsimps [localTo_def, stable_def, Diff_self_constrains]) 1);
paulson@7594
   338
qed "self_localTo";
paulson@7594
   339
paulson@7594
   340
paulson@5804
   341
paulson@5804
   342
(*** Higher-level rules involving localTo and Join ***)
paulson@5804
   343
paulson@7826
   344
Goal "[| F : {s. P (v s)} co {s. P' (v s)};  G : v localTo F |]  \
paulson@7826
   345
\     ==> F Join G : {s. P (v s)} co {s. P' (v s)}";
paulson@7826
   346
by (asm_simp_tac (simpset() addsimps [Join_constrains]) 1);
paulson@7826
   347
by (auto_tac (claset(), 
paulson@7826
   348
	      simpset() addsimps [localTo_def, stable_def, constrains_def,
paulson@7826
   349
				  Diff_def]));
paulson@7826
   350
by (case_tac "act: Acts F" 1);
paulson@7826
   351
by (Blast_tac 1);
paulson@7826
   352
by (dtac bspec 1 THEN rtac Id_in_Acts 1);
paulson@7826
   353
by (subgoal_tac "v x = v xa" 1);
paulson@7826
   354
by Auto_tac;
paulson@7826
   355
qed "constrains_localTo_constrains";
paulson@7826
   356
paulson@7826
   357
Goalw [localTo_def, stable_def, constrains_def, Diff_def]
paulson@7826
   358
     "[| G : v localTo F;  G : w localTo F |]  \
paulson@7826
   359
\     ==> G : (%s. (v s, w s)) localTo F";
paulson@7826
   360
by (Blast_tac 1);
paulson@7826
   361
qed "localTo_pairfun";
paulson@7826
   362
paulson@6536
   363
Goal "[| F : {s. P (v s) (w s)} co {s. P' (v s) (w s)};   \
paulson@7826
   364
\        G : v localTo F;       \
paulson@7826
   365
\        G : w localTo F |]               \
paulson@6536
   366
\     ==> F Join G : {s. P (v s) (w s)} co {s. P' (v s) (w s)}";
paulson@7826
   367
by (res_inst_tac [("A", "{s. (%(x,y). P x y) (v s, w s)}"),
paulson@7826
   368
		  ("A'", "{s. (%(x,y). P' x y) (v s, w s)}")] 
paulson@7826
   369
    constrains_weaken 1);
paulson@7826
   370
by (rtac (localTo_pairfun RSN (2, constrains_localTo_constrains)) 1);
paulson@6295
   371
by Auto_tac;
paulson@5804
   372
qed "constrains_localTo_constrains2";
paulson@5804
   373
paulson@5804
   374
Goalw [stable_def]
paulson@5804
   375
     "[| F : stable {s. P (v s) (w s)};   \
paulson@7826
   376
\        G : v localTo F;  G : w localTo F |]               \
paulson@5804
   377
\     ==> F Join G : stable {s. P (v s) (w s)}";
paulson@5804
   378
by (blast_tac (claset() addIs [constrains_localTo_constrains2]) 1);
paulson@5804
   379
qed "stable_localTo_stable2";
paulson@5804
   380
paulson@5804
   381
Goal "[| F : stable {s. v s <= w s};   \
paulson@7594
   382
\        G : v localTo F;       \
paulson@7826
   383
\        F Join G : Increasing w |]               \
paulson@5804
   384
\     ==> F Join G : Stable {s. v s <= w s}";
paulson@7826
   385
by (auto_tac (claset(), 
paulson@7826
   386
	      simpset() addsimps [stable_def, Stable_def, Increasing_def, 
paulson@7826
   387
		    Constrains_def, Join_constrains, all_conj_distrib]));
paulson@7826
   388
by (blast_tac (claset() addIs [constrains_weaken]) 1);
paulson@7826
   389
(*The G case remains; proved like constrains_localTo_constrains*)
paulson@7826
   390
by (auto_tac (claset(), 
paulson@7826
   391
	      simpset() addsimps [localTo_def, stable_def, constrains_def,
paulson@7826
   392
				  Diff_def]));
paulson@7826
   393
by (case_tac "act: Acts F" 1);
paulson@7826
   394
by (Blast_tac 1);
paulson@7826
   395
by (thin_tac "ALL act:Acts F. ?P act" 1);
paulson@7826
   396
by (thin_tac "ALL z. ALL act:Acts F. ?P z act" 1);
paulson@7826
   397
by (dres_inst_tac [("x", "v xa")] spec 1 THEN dtac bspec 1 THEN rtac DiffI 1);
paulson@7826
   398
by (assume_tac 1);
paulson@7826
   399
by (Blast_tac 1);
paulson@7826
   400
by (subgoal_tac "v x = v xa" 1);
paulson@5804
   401
by Auto_tac;
paulson@5804
   402
qed "Increasing_localTo_Stable";