-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tau_Chain.thy
1616 lines (1369 loc) · 89.9 KB
/
Tau_Chain.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*
Title: Psi-calculi
Based on the AFP entry by Jesper Bengtson ([email protected]), 2012
*)
theory Tau_Chain
imports Semantics
begin
context env begin
abbreviation tau_chain :: "'b \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<rhd> _ \<Longrightarrow>\<^sup>^\<^sub>\<tau> _" [80, 80, 80] 80)
where "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P' \<equiv> (P, P') \<in> {(P, P'). \<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'}^*"
abbreviation tau_step_chain :: "'b \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<rhd> _ \<Longrightarrow>\<^sub>\<tau> _" [80, 80, 80] 80)
where "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P' \<equiv> (P, P') \<in> {(P, P'). \<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'}^+"
abbreviation tau_context_chain :: "('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<Longrightarrow>\<^sup>^\<^sub>\<tau> _" [80, 80] 80)
where "P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P' \<equiv> \<one> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
abbreviation tau_context_step_chain :: "('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<Longrightarrow>\<^sub>\<tau> _" [80, 80] 80)
where "P \<Longrightarrow>\<^sub>\<tau> P' \<equiv> \<one> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
lemmas tau_chain_induct[consumes 1, case_names tau_base tau_step] = rtrancl.induct[of _ _ "{(P, P'). \<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'}", simplified] for \<Psi>
lemmas tau_step_chain_induct[consumes 1, case_names tau_base tau_step] = trancl.induct[of _ _ "{(P, P'). \<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'}", simplified] for \<Psi>
lemma tau_act_tau_step_chain:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'"
shows "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
using assms by auto
lemma tau_act_tau_chain:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'"
shows "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
using assms by(auto simp add: rtrancl_eq_or_trancl)
lemma tau_step_chainEqvt[eqvt]:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
shows "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sub>\<tau> (p \<bullet> P')"
using assms
proof(induct rule: tau_step_chain_induct)
case(tau_base P P')
hence "\<Psi> \<rhd> P \<longmapsto>None @ \<tau> \<prec> P'" by simp
thus ?case by(force dest: semantics.eqvt simp add: eqvts)
next
case(tau_step P P' P'')
hence "\<Psi> \<rhd> P' \<longmapsto>None @ \<tau> \<prec> P''" by simp
hence "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P') \<longmapsto>None @ \<tau> \<prec> (p \<bullet> P'')" by(force dest: semantics.eqvt simp add: eqvts)
with `(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sub>\<tau> (p \<bullet> P')` show ?case
by(subst trancl.trancl_into_trancl) auto
qed
lemma tau_chain_eqvt[eqvt]:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
shows "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sup>^\<^sub>\<tau> (p \<bullet> P')"
using assms
by(auto simp add: rtrancl_eq_or_trancl eqvts)
lemma tau_step_chainEqvt'[eqvt]:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
shows "(p \<bullet> (\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P')) = (p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sub>\<tau> (p \<bullet> P')"
apply(auto simp add: eqvts perm_set_def pt_bij[OF pt_name_inst, OF at_name_inst])
by(drule_tac p="rev p" in tau_step_chainEqvt) auto
lemma tau_chain_eqvt'[eqvt]:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
shows "(p \<bullet> (\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P')) = (p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sup>^\<^sub>\<tau> (p \<bullet> P')"
apply(auto simp add: eqvts perm_set_def pt_bij[OF pt_name_inst, OF at_name_inst] rtrancl_eq_or_trancl)
by(drule_tac p="rev p" in tau_step_chainEqvt) auto
lemma tau_step_chainFresh:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "x \<sharp> P"
shows "x \<sharp> P'"
using assms
by(induct rule: trancl.induct) (auto dest: tau_fresh_derivative)
lemma tau_chainFresh:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "x \<sharp> P"
shows "x \<sharp> P'"
using assms
by(auto simp add: rtrancl_eq_or_trancl intro: tau_step_chainFresh)
lemma tau_step_chain_fresh_chain:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and xvec :: "name list"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "xvec \<sharp>* P"
shows "xvec \<sharp>* P'"
using assms
by(induct xvec) (auto intro: tau_step_chainFresh)
lemma tau_chain_fresh_chain:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and xvec :: "name list"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "xvec \<sharp>* P"
shows "xvec \<sharp>* P'"
using assms
by(induct xvec) (auto intro: tau_chainFresh)
lemma tau_step_chain_case:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and \<phi> :: 'c
and Cs :: "('c \<times> ('a, 'b, 'c) psi) list"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "(\<phi>, P) mem Cs"
and "\<Psi> \<turnstile> \<phi>"
and "guarded P"
shows "\<Psi> \<rhd> (Cases Cs) \<Longrightarrow>\<^sub>\<tau> P'"
using assms
by(induct rule: trancl.induct; force dest: Case intro: trancl_into_trancl)
lemma tau_step_chain_res_pres:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "x \<sharp> \<Psi>"
shows "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>\<^sub>\<tau> \<lparr>\<nu>x\<rparr>P'"
using assms
by(induct rule: trancl.induct)
(auto dest: Scope[where \<pi>=None,simplified] trancl_into_trancl)
lemma tau_chain_res_pres:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "x \<sharp> \<Psi>"
shows "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>\<^sup>^\<^sub>\<tau> \<lparr>\<nu>x\<rparr>P'"
using assms
by(auto simp add: rtrancl_eq_or_trancl intro: tau_step_chain_res_pres)
lemma tau_step_chainResChainPres:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and xvec :: "name list"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "xvec \<sharp>* \<Psi>"
shows "\<Psi> \<rhd> \<lparr>\<nu>*xvec\<rparr>P \<Longrightarrow>\<^sub>\<tau> \<lparr>\<nu>*xvec\<rparr>P'"
using assms
by(induct xvec) (auto intro: tau_step_chain_res_pres)
lemma tau_chain_res_chain_pres:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and xvec :: "name list"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "xvec \<sharp>* \<Psi>"
shows "\<Psi> \<rhd> \<lparr>\<nu>*xvec\<rparr>P \<Longrightarrow>\<^sup>^\<^sub>\<tau> \<lparr>\<nu>*xvec\<rparr>P'"
using assms
by(induct xvec) (auto intro: tau_chain_res_pres)
lemma tau_step_chain_par1:
fixes \<Psi> :: 'b
and \<Psi>\<^sub>Q :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and A\<^sub>Q :: "name list"
assumes "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "extract_frame Q = \<langle>A\<^sub>Q, \<Psi>\<^sub>Q\<rangle>"
and "A\<^sub>Q \<sharp>* \<Psi>"
and "A\<^sub>Q \<sharp>* P"
shows "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sub>\<tau> P' \<parallel> Q"
using assms
by(induct rule: trancl.induct) (auto dest: Par1[where \<pi>=None,simplified] tau_step_chain_fresh_chain trancl_into_trancl)
lemma tau_chain_par1:
fixes \<Psi> :: 'b
and \<Psi>\<^sub>Q :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and A\<^sub>Q :: "name list"
assumes "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "extract_frame Q = \<langle>A\<^sub>Q, \<Psi>\<^sub>Q\<rangle>"
and "A\<^sub>Q \<sharp>* \<Psi>"
and "A\<^sub>Q \<sharp>* P"
shows "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> P' \<parallel> Q"
using assms
by(auto simp add: rtrancl_eq_or_trancl intro: tau_step_chain_par1)
lemma tau_step_chain_par2:
fixes \<Psi> :: 'b
and \<Psi>\<^sub>P :: 'b
and Q :: "('a, 'b, 'c) psi"
and Q' :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and A\<^sub>P :: "name list"
assumes "\<Psi> \<otimes> \<Psi>\<^sub>P \<rhd> Q \<Longrightarrow>\<^sub>\<tau> Q'"
and "extract_frame P = \<langle>A\<^sub>P, \<Psi>\<^sub>P\<rangle>"
and "A\<^sub>P \<sharp>* \<Psi>"
and "A\<^sub>P \<sharp>* Q"
shows "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sub>\<tau> P \<parallel> Q'"
using assms
by(induct rule: trancl.induct) (auto dest: Par2[where \<pi>=None,simplified] trancl_into_trancl tau_step_chain_fresh_chain)
lemma tau_chain_par2:
fixes \<Psi> :: 'b
and \<Psi>\<^sub>P :: 'b
and Q :: "('a, 'b, 'c) psi"
and Q' :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and A\<^sub>P :: "name list"
assumes "\<Psi> \<otimes> \<Psi>\<^sub>P \<rhd> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> Q'"
and "extract_frame P = \<langle>A\<^sub>P, \<Psi>\<^sub>P\<rangle>"
and "A\<^sub>P \<sharp>* \<Psi>"
and "A\<^sub>P \<sharp>* Q"
shows "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> P \<parallel> Q'"
using assms
by(auto simp add: rtrancl_eq_or_trancl intro: tau_step_chain_par2)
lemma tau_step_chain_bang:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<parallel> !P \<Longrightarrow>\<^sub>\<tau> P'"
and "guarded P"
shows "\<Psi> \<rhd> !P \<Longrightarrow>\<^sub>\<tau> P'"
using assms
by(induct x1=="P \<parallel> !P" P' rule: trancl.induct) (auto intro: Bang[where \<pi>=None,simplified] dest: trancl_into_trancl)
lemma tau_step_chain_stat_eq:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
and "\<Psi> \<simeq> \<Psi>'"
shows "\<Psi>' \<rhd> P \<Longrightarrow>\<^sub>\<tau> P'"
using assms
by(induct rule: trancl.induct) (auto dest: stat_eq_transition trancl_into_trancl)
lemma tau_chain_stat_eq:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and P' :: "('a, 'b, 'c) psi"
and \<Psi>' :: 'b
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
and "\<Psi> \<simeq> \<Psi>'"
shows "\<Psi>' \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'"
using assms
by(auto simp add: rtrancl_eq_or_trancl intro: tau_step_chain_stat_eq)
definition weak_transition :: "'b \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> 'a frame frame option \<Rightarrow> 'a action \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ : _ \<rhd> _ \<Longrightarrow>_ @ _ \<prec> _" [80, 80, 80, 80, 80, 80] 80)
where
"\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P' \<equiv> \<exists>P''. \<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'' \<and> (insert_assertion (extract_frame Q) \<Psi>) \<hookrightarrow>\<^sub>F (insert_assertion (extract_frame P'') \<Psi>) \<and>
\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
lemma weak_transitionI:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and P'' :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''"
and "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
shows "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
using assms
by(auto simp add: weak_transition_def)
lemma weak_transitionE:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
assumes "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
obtains P'' where "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
using assms
by(auto simp add: weak_transition_def)
lemma weak_transitionClosed[eqvt]:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
assumes "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
shows "(p \<bullet> \<Psi>) : (p \<bullet> Q) \<rhd> (p \<bullet> P) \<Longrightarrow>(p \<bullet> \<pi>) @ (p \<bullet> \<alpha>)\<prec> (p \<bullet> P')"
proof -
from assms obtain P'' where "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
by(rule weak_transitionE)
from `\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''` have "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P) \<Longrightarrow>\<^sup>^\<^sub>\<tau> (p \<bullet> P'')"
by(rule tau_chain_eqvt)
moreover from `insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>`
have "(p \<bullet> (insert_assertion (extract_frame Q) \<Psi>)) \<hookrightarrow>\<^sub>F (p \<bullet> (insert_assertion (extract_frame P'') \<Psi>))"
by(rule Frame_stat_imp_closed)
hence "insert_assertion (extract_frame(p \<bullet> Q)) (p \<bullet> \<Psi>) \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(p \<bullet> P'')) (p \<bullet> \<Psi>)" by(simp add: eqvts)
moreover from `\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'` have "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P'') \<longmapsto>(p \<bullet> \<pi>) @ (p \<bullet> (\<alpha> \<prec> P'))"
by(rule semantics.eqvt)
hence "(p \<bullet> \<Psi>) \<rhd> (p \<bullet> P'') \<longmapsto>(p \<bullet> \<pi>) @ (p \<bullet> \<alpha>) \<prec> (p \<bullet> P')" by(simp add: eqvts)
ultimately show ?thesis by(rule weak_transitionI)
qed
(*
lemma weak_transitionAlpha:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
and yvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<alpha> \<prec> P'"
and S: "set p \<subseteq> set xvec \<times> set(p \<bullet> xvec)"
and "xvec \<sharp>* (p \<bullet> xvec)"
and "(p \<bullet> xvec) \<sharp>* P"
and "(p \<bullet> xvec) \<sharp>* N"
shows "\<Psi> : Q \<rhd> P \<Longrightarrow>M\<lparr>\<nu>*(p \<bullet> xvec)\<rparr>\<langle>(p \<bullet> N)\<rangle> \<prec> (p \<bullet> P')"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule weak_transitionE)
note PChain qeq_p''
moreover from PChain `(p \<bullet> xvec) \<sharp>* P` have "(p \<bullet> xvec) \<sharp>* P''" by(rule tau_chain_fresh_chain)
with P''Trans `xvec \<sharp>* (p \<bullet> xvec)` `(p \<bullet> xvec) \<sharp>* N` have "(p \<bullet> xvec) \<sharp>* P'"
by(force intro: output_fresh_chain_derivative)
with P''Trans S `(p \<bullet> xvec) \<sharp>* N` have "\<Psi> \<rhd> P'' \<longmapsto>M\<lparr>\<nu>*(p \<bullet> xvec)\<rparr>\<langle>(p \<bullet> N)\<rangle> \<prec> (p \<bullet> P')"
by(simp add: bound_output_chain_alpha'')
ultimately show ?thesis by(rule weak_transitionI)
qed
*)
lemma weak_output_alpha:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
and yvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>\<nu>*(p \<bullet> xvec)\<rparr>\<langle>(p \<bullet> N)\<rangle> \<prec> P'"
and S: "set p \<subseteq> set xvec \<times> set(p \<bullet> xvec)"
and "distinct_perm p"
and "xvec \<sharp>* P"
and "xvec \<sharp>* (p \<bullet> xvec)"
and "(p \<bullet> xvec) \<sharp>* M"
and "distinct xvec"
shows "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> (p \<bullet> P')"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>\<nu>*(p \<bullet> xvec)\<rparr>\<langle>(p \<bullet> N)\<rangle> \<prec> P'"
by(rule weak_transitionE)
note PChain qeq_p''
moreover from PChain `xvec \<sharp>* P` have "xvec \<sharp>* P''" by(rule tau_chain_fresh_chain)
with P''Trans `xvec \<sharp>* (p \<bullet> xvec)` `distinct xvec` `(p \<bullet> xvec) \<sharp>* M` have "xvec \<sharp>* (p \<bullet> N)" and "xvec \<sharp>* P'"
by(force intro: output_fresh_chain_derivative)+
hence "(p \<bullet> xvec) \<sharp>* (p \<bullet> p \<bullet> N)" and "(p \<bullet> xvec) \<sharp>* (p \<bullet> P')"
by(simp add: pt_fresh_star_bij[OF pt_name_inst, OF at_name_inst])+
with `distinct_perm p` have "(p \<bullet> xvec) \<sharp>* N" and "(p \<bullet> xvec) \<sharp>* (p \<bullet> P')" by simp+
with P''Trans S `distinct_perm p` have "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> (p \<bullet> P')"
apply(simp add: residual_inject)
by(subst bound_output_chain_alpha) auto
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_fresh_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
and "x \<sharp> P"
and "x \<sharp> \<alpha>"
and "bn \<alpha> \<sharp>* subject \<alpha>"
and "distinct(bn \<alpha>)"
shows "x \<sharp> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
by(rule weak_transitionE)
from PChain `x \<sharp> P` have "x \<sharp> P''" by(rule tau_chainFresh)
with P''Trans show "x \<sharp> P'" using `x \<sharp> \<alpha>` `bn \<alpha> \<sharp>* subject \<alpha>` `distinct(bn \<alpha>)`
by(force intro: free_fresh_derivative)
qed
lemma weak_fresh_chain_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and yvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
and "yvec \<sharp>* P"
and "yvec \<sharp>* \<alpha>"
and "bn \<alpha> \<sharp>* subject \<alpha>"
and "distinct(bn \<alpha>)"
shows "yvec \<sharp>* P'"
using assms
by(induct yvec) (auto intro: weak_fresh_derivative)
lemma weak_input_fresh_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
and "x \<sharp> P"
and "x \<sharp> N"
shows "x \<sharp> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
by(rule weak_transitionE)
from PChain `x \<sharp> P` have "x \<sharp> P''" by(rule tau_chainFresh)
with P''Trans show "x \<sharp> P'" using `x \<sharp> N`
by(force intro: input_fresh_derivative)
qed
lemma weak_input_fresh_chain_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and xvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
and "xvec \<sharp>* P"
and "xvec \<sharp>* N"
shows "xvec \<sharp>* P'"
using assms
by(induct xvec) (auto intro: weak_input_fresh_derivative)
lemma weak_output_fresh_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and x :: name
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
and "x \<sharp> P"
and "x \<sharp> xvec"
and "xvec \<sharp>* M"
and "distinct xvec"
shows "x \<sharp> N"
and "x \<sharp> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule weak_transitionE)
from PChain `x \<sharp> P` have "x \<sharp> P''" by(rule tau_chainFresh)
with P''Trans show "x \<sharp> N" and "x \<sharp> P'" using `x \<sharp> xvec` `xvec \<sharp>* M` `distinct xvec`
by(force intro: output_fresh_derivative)+
qed
lemma weak_output_fresh_chain_derivative:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and yvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
and "yvec \<sharp>* P"
and "xvec \<sharp>* yvec"
and "xvec \<sharp>* M"
and "distinct xvec"
shows "yvec \<sharp>* N"
and "yvec \<sharp>* P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule weak_transitionE)
from PChain `yvec \<sharp>* P` have "yvec \<sharp>* P''" by(rule tau_chain_fresh_chain)
with P''Trans show "yvec \<sharp>* N" and "yvec \<sharp>* P'" using `xvec \<sharp>* yvec` `xvec \<sharp>* M` `distinct xvec`
by(force intro: output_fresh_chain_derivative)+
qed
lemma weak_output_perm_subject:
fixes \<Psi> :: 'b
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
and yvec :: "name list"
and zvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
and S: "set p \<subseteq> set yvec \<times> set zvec"
and "yvec \<sharp>* \<Psi>"
and "zvec \<sharp>* \<Psi>"
and "yvec \<sharp>* P"
and "zvec \<sharp>* P"
shows "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ (p \<bullet> M)\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule weak_transitionE)
from PChain `yvec \<sharp>* P` `zvec \<sharp>* P` have "yvec \<sharp>* P''" and "zvec \<sharp>* P''"
by(force intro: tau_chain_fresh_chain)+
note PChain qeq_p''
moreover from P''Trans S `yvec \<sharp>* \<Psi>` `zvec \<sharp>* \<Psi>` `yvec \<sharp>* P''` `zvec \<sharp>* P''` have "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ (p \<bullet> M)\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule_tac output_perm_subject) (assumption | auto)
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_input_perm_subject:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
and p :: "name prm"
and yvec :: "name list"
and zvec :: "name list"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
and S: "set p \<subseteq> set yvec \<times> set zvec"
and "yvec \<sharp>* \<Psi>"
and "zvec \<sharp>* \<Psi>"
and "yvec \<sharp>* P"
and "zvec \<sharp>* P"
shows "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ (p \<bullet> M)\<lparr>N\<rparr> \<prec> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
by(rule weak_transitionE)
from PChain `yvec \<sharp>* P` `zvec \<sharp>* P` have "yvec \<sharp>* P''" and "zvec \<sharp>* P''"
by(force intro: tau_chain_fresh_chain)+
note PChain qeq_p''
moreover from P''Trans S `yvec \<sharp>* \<Psi>` `zvec \<sharp>* \<Psi>` `yvec \<sharp>* P''` `zvec \<sharp>* P''` have "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ (p \<bullet> M)\<lparr>N\<rparr> \<prec> P'"
by(rule_tac input_perm_subject) auto
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_input:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and M :: 'a
and K :: 'a
and xvec :: "name list"
and N :: 'a
and Tvec :: "'a list"
and P :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<turnstile> K \<leftrightarrow> M"
and "distinct xvec"
and "set xvec \<subseteq> supp N"
and "length xvec = length Tvec"
and Qeq\<Psi>: "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F \<langle>\<epsilon>, \<Psi> \<otimes> \<one>\<rangle>"
shows "\<Psi> : Q \<rhd> M\<lparr>\<lambda>*xvec N\<rparr>.P \<Longrightarrow>Some(\<langle>\<epsilon>; \<epsilon>, M\<rangle>) @ K\<lparr>(N[xvec::=Tvec])\<rparr> \<prec> P[xvec::=Tvec]"
proof -
have "\<Psi> \<rhd> M\<lparr>\<lambda>*xvec N\<rparr>.P \<Longrightarrow>\<^sup>^\<^sub>\<tau> M\<lparr>\<lambda>*xvec N\<rparr>.P" by simp
moreover from Qeq\<Psi> have "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(M\<lparr>\<lambda>*xvec N\<rparr>.P)) \<Psi>"
by auto
moreover from assms have "\<Psi> \<rhd> M\<lparr>\<lambda>*xvec N\<rparr>.P \<longmapsto>Some(\<langle>\<epsilon>; \<epsilon>, M\<rangle>) @ K\<lparr>(N[xvec::=Tvec])\<rparr> \<prec> P[xvec::=Tvec]"
by(rule_tac Input)
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_output:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and M :: 'a
and K :: 'a
and N :: 'a
and P :: "('a, 'b, 'c) psi"
assumes "\<Psi> \<turnstile> M \<leftrightarrow> K"
and Qeq\<Psi>: "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F \<langle>\<epsilon>, \<Psi> \<otimes> \<one>\<rangle>"
shows "\<Psi> : Q \<rhd> M\<langle>N\<rangle>.P \<Longrightarrow>Some(\<langle>\<epsilon>; \<epsilon>, M\<rangle>) @ K\<langle>N\<rangle> \<prec> P"
proof -
have "\<Psi> \<rhd> M\<langle>N\<rangle>.P \<Longrightarrow>\<^sup>^\<^sub>\<tau> M\<langle>N\<rangle>.P" by simp
moreover from Qeq\<Psi> have "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(M\<langle>N\<rangle>.P)) \<Psi>"
by auto
moreover have "insert_assertion (extract_frame(M\<langle>N\<rangle>.P)) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(M\<langle>N\<rangle>.P)) \<Psi>" by simp
moreover from `\<Psi> \<turnstile> M \<leftrightarrow> K` have "\<Psi> \<rhd> M\<langle>N\<rangle>.P \<longmapsto>Some(\<langle>\<epsilon>; \<epsilon>, M\<rangle>) @ K\<langle>N\<rangle> \<prec> P"
by(rule Output)
ultimately show ?thesis by(rule_tac weak_transitionI) auto
qed
lemma insert_guarded_assertion:
fixes P :: "('a, 'b, 'c) psi"
assumes "guarded P"
shows "insert_assertion(extract_frame P) \<Psi> \<simeq>\<^sub>F \<langle>\<epsilon>, \<Psi> \<otimes> \<one>\<rangle>"
proof -
obtain A\<^sub>P \<Psi>\<^sub>P where fr_p: "extract_frame P = \<langle>A\<^sub>P, \<Psi>\<^sub>P\<rangle>" and "A\<^sub>P \<sharp>* \<Psi>" by(rule fresh_frame)
from `guarded P` fr_p have "\<Psi>\<^sub>P \<simeq> \<one>" and "supp \<Psi>\<^sub>P = ({}::name set)"
by(blast dest: guarded_stat_eq)+
from fr_p `A\<^sub>P \<sharp>* \<Psi>` `\<Psi>\<^sub>P \<simeq> \<one>` have "insert_assertion(extract_frame P) \<Psi> \<simeq>\<^sub>F \<langle>A\<^sub>P, \<Psi> \<otimes> \<one>\<rangle>"
by simp (metis frame_int_composition_sym)
moreover from `A\<^sub>P \<sharp>* \<Psi>` have "\<langle>A\<^sub>P, \<Psi> \<otimes> \<one>\<rangle> \<simeq>\<^sub>F \<langle>\<epsilon>, \<Psi> \<otimes> \<one>\<rangle>"
by(rule_tac frame_res_fresh_chain) auto
ultimately show ?thesis by(rule Frame_stat_eq_trans)
qed
lemma weak_case:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and R :: "('a, 'b, 'c) psi"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
and "(\<phi>, P) mem cs_p"
and "\<Psi> \<turnstile> \<phi>"
and "guarded P"
and r_imp_q: "insert_assertion (extract_frame R) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame Q) \<Psi>"
and imp_r: "insert_assertion (extract_frame R) \<Psi> \<hookrightarrow>\<^sub>F \<langle>\<epsilon>, \<Psi>\<rangle>"
shows "\<Psi> : R \<rhd> Cases cs_p \<Longrightarrow>\<pi> @ \<alpha> \<prec> P' \<or> \<Psi> : R \<rhd> Cases cs_p \<Longrightarrow>map_option (F_assert o push_prov) \<pi> @ \<alpha> \<prec> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''"
and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
by(rule weak_transitionE)
show ?thesis
proof(case_tac "P = P''")
assume "P = P''"
have "\<Psi> \<rhd> Cases cs_p \<Longrightarrow>\<^sup>^\<^sub>\<tau> Cases cs_p" by simp
moreover from imp_r Assertion_stat_eq_def have "insert_assertion(extract_frame R) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion(extract_frame(Cases cs_p)) \<Psi>"
by(rule_tac Frame_stat_imp_trans) (auto intro: Identity)+
moreover from P''Trans `(\<phi>, P) mem cs_p` `\<Psi> \<turnstile> \<phi>` `guarded P` `P = P''` have "\<Psi> \<rhd> Cases cs_p \<longmapsto>map_option (F_assert o push_prov) \<pi> @ \<alpha> \<prec> P'"
by(blast intro: Case)
ultimately show ?thesis
by(metis weak_transitionI)
next
assume "P \<noteq> P''"
with PChain have "\<Psi> \<rhd> P \<Longrightarrow>\<^sub>\<tau> P''" by(simp add: rtrancl_eq_or_trancl)
hence "\<Psi> \<rhd> Cases cs_p \<Longrightarrow>\<^sub>\<tau> P''" using `(\<phi>, P) mem cs_p` `\<Psi> \<turnstile> \<phi>` `guarded P`
by(rule tau_step_chain_case)
hence "\<Psi> \<rhd> Cases cs_p \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" by simp
moreover from r_imp_q qeq_p'' have "insert_assertion(extract_frame R) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion(extract_frame P'') \<Psi>"
by(rule Frame_stat_imp_trans)
ultimately show ?thesis using P''Trans by(metis weak_transitionI)
qed
qed
lemma weak_open:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and yvec :: "name list"
and N :: 'a
and P' :: "('a, 'b, 'c) psi"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>Some \<pi> @ M\<lparr>\<nu>*(xvec@yvec)\<rparr>\<langle>N\<rangle> \<prec> P'"
and "x \<in> supp N"
and "x \<sharp> \<Psi>"
and "x \<sharp> M"
and "x \<sharp> xvec"
and "x \<sharp> yvec"
shows "\<Psi> : \<lparr>\<nu>x\<rparr>Q \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>Some(\<lparr>\<nu>x\<rparr>\<pi>) @ M\<lparr>\<nu>*(xvec@x#yvec)\<rparr>\<langle>N\<rangle> \<prec> P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>Some \<pi> @ M\<lparr>\<nu>*(xvec@yvec)\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule weak_transitionE)
from PChain `x \<sharp> \<Psi>` have "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>\<^sup>^\<^sub>\<tau> \<lparr>\<nu>x\<rparr>P''" by(rule tau_chain_res_pres)
moreover from qeq_p'' `x \<sharp> \<Psi>` have "insert_assertion (extract_frame(\<lparr>\<nu>x\<rparr>Q)) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(\<lparr>\<nu>x\<rparr>P'')) \<Psi>" by(force intro: frame_imp_res_pres)
moreover from P''Trans `x \<in> supp N` `x \<sharp> \<Psi>` `x \<sharp> M` `x \<sharp> xvec` `x \<sharp> yvec` have "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P'' \<longmapsto>Some(\<lparr>\<nu>x\<rparr>\<pi>) @ M\<lparr>\<nu>*(xvec@x#yvec)\<rparr>\<langle>N\<rangle> \<prec> P'"
by(rule Open)
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_scope:
fixes \<Psi> :: 'b
and Q :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
assumes PTrans: "\<Psi> : Q \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
and "x \<sharp> \<Psi>"
and "x \<sharp> \<alpha>"
shows "\<Psi> : \<lparr>\<nu>x\<rparr>Q \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>map_option (F_res x) \<pi> @ \<alpha> \<prec> \<lparr>\<nu>x\<rparr>P'"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''" and qeq_p'': "insert_assertion (extract_frame Q) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') \<Psi>"
and P''Trans: "\<Psi> \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
by(rule weak_transitionE)
from PChain `x \<sharp> \<Psi>` have "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P \<Longrightarrow>\<^sup>^\<^sub>\<tau> \<lparr>\<nu>x\<rparr>P''" by(rule tau_chain_res_pres)
moreover from qeq_p'' `x \<sharp> \<Psi>` have "insert_assertion (extract_frame(\<lparr>\<nu>x\<rparr>Q)) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(\<lparr>\<nu>x\<rparr>P'')) \<Psi>" by(force intro: frame_imp_res_pres)
moreover from P''Trans `x \<sharp> \<Psi>` `x \<sharp> \<alpha>` have "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>P'' \<longmapsto>map_option (F_res x) \<pi> @ \<alpha> \<prec> \<lparr>\<nu>x\<rparr>P'"
by(rule Scope)
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_par1:
fixes \<Psi> :: 'b
and R :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and A\<^sub>Q :: "name list"
and \<Psi>\<^sub>Q :: 'b
assumes PTrans: "\<Psi> \<otimes> \<Psi>\<^sub>Q : R \<rhd> P \<Longrightarrow>\<pi> @ \<alpha> \<prec> P'"
and fr_q: "extract_frame Q = \<langle>A\<^sub>Q, \<Psi>\<^sub>Q\<rangle>"
and "bn \<alpha> \<sharp>* Q"
and "A\<^sub>Q \<sharp>* \<Psi>"
and "A\<^sub>Q \<sharp>* P"
and "A\<^sub>Q \<sharp>* \<alpha>"
and "A\<^sub>Q \<sharp>* R"
shows "\<Psi> : R \<parallel> Q \<rhd> P \<parallel> Q \<Longrightarrow>append_at_end_prov_option \<pi> A\<^sub>Q @ \<alpha> \<prec> P' \<parallel> Q"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''"
and req_p'': "insert_assertion (extract_frame R) (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') (\<Psi> \<otimes> \<Psi>\<^sub>Q)"
and P''Trans: "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P'' \<longmapsto>\<pi> @ \<alpha> \<prec> P'"
by(rule weak_transitionE)
from PChain `A\<^sub>Q \<sharp>* P` have "A\<^sub>Q \<sharp>* P''" by(rule tau_chain_fresh_chain)
from PChain fr_q `A\<^sub>Q \<sharp>* \<Psi>` `A\<^sub>Q \<sharp>* P` have "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> P'' \<parallel> Q" by(rule tau_chain_par1)
moreover have "insert_assertion (extract_frame(R \<parallel> Q)) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(P'' \<parallel> Q)) \<Psi>"
proof -
obtain A\<^sub>R \<Psi>\<^sub>R where fr_r: "extract_frame R = \<langle>A\<^sub>R, \<Psi>\<^sub>R\<rangle>" and "A\<^sub>R \<sharp>* A\<^sub>Q" and "A\<^sub>R \<sharp>* \<Psi>\<^sub>Q" and "A\<^sub>R \<sharp>* \<Psi>"
by(rule_tac C="(A\<^sub>Q, \<Psi>\<^sub>Q, \<Psi>)" in fresh_frame) auto
obtain A\<^sub>P'' \<Psi>\<^sub>P'' where fr_p'': "extract_frame P'' = \<langle>A\<^sub>P'', \<Psi>\<^sub>P''\<rangle>" and "A\<^sub>P'' \<sharp>* A\<^sub>Q" and "A\<^sub>P'' \<sharp>* \<Psi>\<^sub>Q" and "A\<^sub>P'' \<sharp>* \<Psi>"
by(rule_tac C="(A\<^sub>Q, \<Psi>\<^sub>Q, \<Psi>)" in fresh_frame) auto
from fr_r fr_p'' `A\<^sub>Q \<sharp>* R` `A\<^sub>Q \<sharp>* P''` `A\<^sub>R \<sharp>* A\<^sub>Q` `A\<^sub>P'' \<sharp>* A\<^sub>Q` have "A\<^sub>Q \<sharp>* \<Psi>\<^sub>R" and "A\<^sub>Q \<sharp>* \<Psi>\<^sub>P''"
by(force dest: extract_frame_fresh_chain)+
have "\<langle>A\<^sub>R, \<Psi> \<otimes> \<Psi>\<^sub>R \<otimes> \<Psi>\<^sub>Q\<rangle> \<simeq>\<^sub>F \<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<otimes> \<Psi>\<^sub>R\<rangle>"
by(metis frame_nil_stat_eq frame_res_chain_pres Associativity Commutativity Composition Assertion_stat_eq_trans)
moreover from req_p'' fr_r fr_p'' `A\<^sub>R \<sharp>* \<Psi>` `A\<^sub>R \<sharp>* \<Psi>\<^sub>Q` `A\<^sub>P'' \<sharp>* \<Psi>` `A\<^sub>P'' \<sharp>* \<Psi>\<^sub>Q`
have "\<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<otimes> \<Psi>\<^sub>R\<rangle> \<hookrightarrow>\<^sub>F \<langle>A\<^sub>P'', (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<otimes> \<Psi>\<^sub>P''\<rangle>" using fresh_comp_chain by auto
moreover have "\<langle>A\<^sub>P'', (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<otimes> \<Psi>\<^sub>P''\<rangle> \<simeq>\<^sub>F \<langle>A\<^sub>P'', \<Psi> \<otimes> \<Psi>\<^sub>P'' \<otimes> \<Psi>\<^sub>Q\<rangle>"
by(metis frame_nil_stat_eq frame_res_chain_pres Associativity Commutativity Composition Assertion_stat_eq_trans)
ultimately have "\<langle>A\<^sub>R, \<Psi> \<otimes> \<Psi>\<^sub>R \<otimes> \<Psi>\<^sub>Q\<rangle> \<hookrightarrow>\<^sub>F \<langle>A\<^sub>P'', \<Psi> \<otimes> \<Psi>\<^sub>P'' \<otimes> \<Psi>\<^sub>Q\<rangle>"
by(force dest: Frame_stat_imp_trans simp add: Frame_stat_eq_def)
hence "\<langle>(A\<^sub>R@A\<^sub>Q), \<Psi> \<otimes> \<Psi>\<^sub>R \<otimes> \<Psi>\<^sub>Q\<rangle> \<hookrightarrow>\<^sub>F \<langle>(A\<^sub>P''@A\<^sub>Q), \<Psi> \<otimes> \<Psi>\<^sub>P'' \<otimes> \<Psi>\<^sub>Q\<rangle>"
apply(simp add: frame_chain_append)
apply(drule_tac xvec=A\<^sub>Q in frame_imp_res_chain_pres)
by(metis frame_imp_chain_comm Frame_stat_imp_trans)
with fr_r fr_q fr_p'' `A\<^sub>R \<sharp>* A\<^sub>Q` `A\<^sub>R \<sharp>* \<Psi>\<^sub>Q` `A\<^sub>Q \<sharp>* \<Psi>\<^sub>R` `A\<^sub>P'' \<sharp>* A\<^sub>Q` `A\<^sub>P'' \<sharp>* \<Psi>\<^sub>Q` `A\<^sub>Q \<sharp>* \<Psi>\<^sub>P''` `A\<^sub>R \<sharp>* \<Psi>` `A\<^sub>P'' \<sharp>* \<Psi>` `A\<^sub>Q \<sharp>* \<Psi>` req_p''
show ?thesis by simp
qed
moreover from P''Trans fr_q `bn \<alpha> \<sharp>* Q` `A\<^sub>Q \<sharp>* \<Psi>` `A\<^sub>Q \<sharp>* P''` `A\<^sub>Q \<sharp>* \<alpha>` have "\<Psi> \<rhd> P'' \<parallel> Q \<longmapsto>append_at_end_prov_option \<pi> A\<^sub>Q @ \<alpha> \<prec> (P' \<parallel> Q)"
by(rule Par1)
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_par2:
fixes \<Psi> :: 'b
and R :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and M :: 'a
and xvec :: "name list"
and N :: 'a
and Q' :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and A\<^sub>P :: "name list"
and \<Psi>\<^sub>P :: 'b
assumes QTrans: "\<Psi> \<otimes> \<Psi>\<^sub>P : R \<rhd> Q \<Longrightarrow>\<pi> @ \<alpha> \<prec> Q'"
and fr_p: "extract_frame P = \<langle>A\<^sub>P, \<Psi>\<^sub>P\<rangle>"
and "bn \<alpha> \<sharp>* P"
and "A\<^sub>P \<sharp>* \<Psi>"
and "A\<^sub>P \<sharp>* Q"
and "A\<^sub>P \<sharp>* \<alpha>"
and "A\<^sub>P \<sharp>* R"
shows "\<Psi> : P \<parallel> R \<rhd> P \<parallel> Q \<Longrightarrow>append_at_front_prov_option \<pi> A\<^sub>P @ \<alpha> \<prec> P \<parallel> Q'"
proof -
from QTrans obtain Q'' where QChain: "\<Psi> \<otimes> \<Psi>\<^sub>P \<rhd> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> Q''"
and req_q'': "insert_assertion (extract_frame R) (\<Psi> \<otimes> \<Psi>\<^sub>P) \<hookrightarrow>\<^sub>F insert_assertion (extract_frame Q'') (\<Psi> \<otimes> \<Psi>\<^sub>P)"
and Q''Trans: "\<Psi> \<otimes> \<Psi>\<^sub>P \<rhd> Q'' \<longmapsto>\<pi> @ \<alpha> \<prec> Q'"
by(rule weak_transitionE)
from QChain `A\<^sub>P \<sharp>* Q` have "A\<^sub>P \<sharp>* Q''" by(rule tau_chain_fresh_chain)
from QChain fr_p `A\<^sub>P \<sharp>* \<Psi>` `A\<^sub>P \<sharp>* Q` have "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sup>^\<^sub>\<tau> P \<parallel> Q''" by(rule tau_chain_par2)
moreover have "insert_assertion (extract_frame(P \<parallel> R)) \<Psi> \<hookrightarrow>\<^sub>F insert_assertion (extract_frame(P \<parallel> Q'')) \<Psi>"
proof -
obtain A\<^sub>R \<Psi>\<^sub>R where fr_r: "extract_frame R = \<langle>A\<^sub>R, \<Psi>\<^sub>R\<rangle>" and "A\<^sub>R \<sharp>* A\<^sub>P" and "A\<^sub>R \<sharp>* \<Psi>\<^sub>P" and "A\<^sub>R \<sharp>* \<Psi>"
by(rule_tac C="(A\<^sub>P, \<Psi>\<^sub>P, \<Psi>)" in fresh_frame) auto
obtain A\<^sub>Q'' \<Psi>\<^sub>Q'' where fr_q'': "extract_frame Q'' = \<langle>A\<^sub>Q'', \<Psi>\<^sub>Q''\<rangle>" and "A\<^sub>Q'' \<sharp>* A\<^sub>P" and "A\<^sub>Q'' \<sharp>* \<Psi>\<^sub>P" and "A\<^sub>Q'' \<sharp>* \<Psi>"
by(rule_tac C="(A\<^sub>P, \<Psi>\<^sub>P, \<Psi>)" in fresh_frame) auto
from fr_r fr_q'' `A\<^sub>P \<sharp>* R` `A\<^sub>P \<sharp>* Q''` `A\<^sub>R \<sharp>* A\<^sub>P` `A\<^sub>Q'' \<sharp>* A\<^sub>P` have "A\<^sub>P \<sharp>* \<Psi>\<^sub>R" and "A\<^sub>P \<sharp>* \<Psi>\<^sub>Q''"
by(force dest: extract_frame_fresh_chain)+
have "\<langle>A\<^sub>R, \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>R\<rangle> \<simeq>\<^sub>F \<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>P) \<otimes> \<Psi>\<^sub>R\<rangle>"
by(metis frame_nil_stat_eq frame_res_chain_pres Associativity Commutativity Composition Assertion_stat_eq_trans)
moreover from req_q'' fr_r fr_q'' `A\<^sub>R \<sharp>* \<Psi>` `A\<^sub>R \<sharp>* \<Psi>\<^sub>P` `A\<^sub>Q'' \<sharp>* \<Psi>` `A\<^sub>Q'' \<sharp>* \<Psi>\<^sub>P`
have "\<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>P) \<otimes> \<Psi>\<^sub>R\<rangle> \<hookrightarrow>\<^sub>F \<langle>A\<^sub>Q'', (\<Psi> \<otimes> \<Psi>\<^sub>P) \<otimes> \<Psi>\<^sub>Q''\<rangle>" using fresh_comp_chain by simp
moreover have "\<langle>A\<^sub>Q'', (\<Psi> \<otimes> \<Psi>\<^sub>P) \<otimes> \<Psi>\<^sub>Q''\<rangle> \<simeq>\<^sub>F \<langle>A\<^sub>Q'', \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>Q''\<rangle>"
by(metis frame_nil_stat_eq frame_res_chain_pres Associativity Commutativity Composition Assertion_stat_eq_trans)
ultimately have "\<langle>A\<^sub>R, \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>R\<rangle> \<hookrightarrow>\<^sub>F \<langle>A\<^sub>Q'', \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>Q''\<rangle>"
by(force dest: Frame_stat_imp_trans simp add: Frame_stat_eq_def)
hence "\<langle>(A\<^sub>P@A\<^sub>R), \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>R\<rangle> \<hookrightarrow>\<^sub>F \<langle>(A\<^sub>P@A\<^sub>Q''), \<Psi> \<otimes> \<Psi>\<^sub>P \<otimes> \<Psi>\<^sub>Q''\<rangle>"
apply(simp add: frame_chain_append)
apply(drule_tac xvec=A\<^sub>P in frame_imp_res_chain_pres)
by(metis frame_imp_chain_comm Frame_stat_imp_trans)
with fr_r fr_p fr_q'' `A\<^sub>R \<sharp>* A\<^sub>P` `A\<^sub>R \<sharp>* \<Psi>\<^sub>P` `A\<^sub>P \<sharp>* \<Psi>\<^sub>R` `A\<^sub>Q'' \<sharp>* A\<^sub>P` `A\<^sub>Q'' \<sharp>* \<Psi>\<^sub>P` `A\<^sub>P \<sharp>* \<Psi>\<^sub>Q''` `A\<^sub>R \<sharp>* \<Psi>` `A\<^sub>Q'' \<sharp>* \<Psi>` `A\<^sub>P \<sharp>* \<Psi>` req_q''
show ?thesis by simp
qed
moreover from Q''Trans fr_p `bn \<alpha> \<sharp>* P` `A\<^sub>P \<sharp>* \<Psi>` `A\<^sub>P \<sharp>* Q''` `A\<^sub>P \<sharp>* \<alpha>` have "\<Psi> \<rhd> P \<parallel> Q'' \<longmapsto>append_at_front_prov_option \<pi> A\<^sub>P @ \<alpha> \<prec> (P \<parallel> Q')"
by(rule_tac Par2) auto
ultimately show ?thesis by(rule weak_transitionI)
qed
lemma weak_comm1:
fixes \<Psi> :: 'b
and R :: "('a, 'b, 'c) psi"
and P :: "('a, 'b, 'c) psi"
and \<alpha> :: "'a action"
and P' :: "('a, 'b, 'c) psi"
and Q :: "('a, 'b, 'c) psi"
and A\<^sub>Q :: "name list"
and \<Psi>\<^sub>Q :: 'b
assumes PTrans: "\<Psi> \<otimes> \<Psi>\<^sub>Q : R \<rhd> P \<Longrightarrow>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
and fr_r: "extract_frame R = \<langle>A\<^sub>R, \<Psi>\<^sub>R\<rangle>"
and QTrans: "\<Psi> \<otimes> \<Psi>\<^sub>R \<rhd> Q \<longmapsto>Some(\<langle>A\<^sub>Q; zvec, M\<rangle>) @ K\<lparr>\<nu>*xvec\<rparr>\<langle>N\<rangle> \<prec> Q'"
and fr_q: "extract_frame Q = \<langle>A\<^sub>Q, \<Psi>\<^sub>Q\<rangle>"
and "A\<^sub>R \<sharp>* \<Psi>"
and "A\<^sub>R \<sharp>* P"
and "A\<^sub>R \<sharp>* Q"
and "A\<^sub>R \<sharp>* R"
and "A\<^sub>R \<sharp>* M"
and "A\<^sub>R \<sharp>* A\<^sub>Q"
and "A\<^sub>Q \<sharp>* \<Psi>"
and "A\<^sub>Q \<sharp>* P"
and "A\<^sub>Q \<sharp>* Q"
and "A\<^sub>Q \<sharp>* R"
and "A\<^sub>Q \<sharp>* K"
and "A\<^sub>Q \<sharp>* zvec"
and "distinct A\<^sub>Q"
and "distinct zvec"
and "xvec \<sharp>* P"
and "zvec \<sharp>* \<Psi>"
and "zvec \<sharp>* Q"
and "zvec \<sharp>* P"
and "zvec \<sharp>* A\<^sub>R"
and "zvec \<sharp>* \<Psi>\<^sub>Q"
shows "\<Psi> \<rhd> P \<parallel> Q \<Longrightarrow>\<^sub>\<tau> (\<lparr>\<nu>*xvec\<rparr>(P' \<parallel> Q'))"
proof -
from PTrans obtain P'' where PChain: "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P \<Longrightarrow>\<^sup>^\<^sub>\<tau> P''"
and rimp_p'': "insert_assertion (extract_frame R) (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<hookrightarrow>\<^sub>F insert_assertion (extract_frame P'') (\<Psi> \<otimes> \<Psi>\<^sub>Q)"
and P''Trans: "\<Psi> \<otimes> \<Psi>\<^sub>Q \<rhd> P'' \<longmapsto>\<pi> @ M\<lparr>N\<rparr> \<prec> P'"
by(rule weak_transitionE)
from PChain `A\<^sub>Q \<sharp>* P` have "A\<^sub>Q \<sharp>* P''" by(rule tau_chain_fresh_chain)
obtain A\<^sub>P'' \<Psi>\<^sub>P'' where fr_p'': "extract_frame P'' = \<langle>A\<^sub>P'', \<Psi>\<^sub>P''\<rangle>" and "A\<^sub>P'' \<sharp>* (\<Psi>, A\<^sub>Q, A\<^sub>Q, \<Psi>\<^sub>Q, A\<^sub>R, \<Psi>\<^sub>R, M, N, K, R, Q, P'', xvec, zvec)" and "distinct A\<^sub>P''"
by(rule fresh_frame)
hence "A\<^sub>P'' \<sharp>* \<Psi>" and "A\<^sub>P'' \<sharp>* A\<^sub>Q" and "A\<^sub>P'' \<sharp>* \<Psi>\<^sub>Q" and "A\<^sub>P'' \<sharp>* M" and "A\<^sub>P'' \<sharp>* R" and "A\<^sub>P'' \<sharp>* Q"
and "A\<^sub>P'' \<sharp>* N" and "A\<^sub>P'' \<sharp>* K" and "A\<^sub>P'' \<sharp>* A\<^sub>R" and "A\<^sub>P'' \<sharp>* P''" and "A\<^sub>P'' \<sharp>* xvec" and "A\<^sub>P'' \<sharp>* \<Psi>\<^sub>R" and "A\<^sub>P'' \<sharp>* zvec"
by simp+
from fr_r `A\<^sub>R \<sharp>* A\<^sub>Q` `A\<^sub>Q \<sharp>* R` have "A\<^sub>Q \<sharp>* \<Psi>\<^sub>R" by(drule_tac extract_frame_fresh_chain) auto
from fr_q `A\<^sub>R \<sharp>* A\<^sub>Q` `A\<^sub>R \<sharp>* Q` have "A\<^sub>R \<sharp>* \<Psi>\<^sub>Q" by(drule_tac extract_frame_fresh_chain) auto
from PChain `xvec \<sharp>* P` have "xvec \<sharp>* P''" by(force intro: tau_chain_fresh_chain)+
have "\<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>R) \<otimes> \<Psi>\<^sub>Q\<rangle> \<simeq>\<^sub>F \<langle>A\<^sub>R, (\<Psi> \<otimes> \<Psi>\<^sub>Q) \<otimes> \<Psi>\<^sub>R\<rangle>"
by(metis frame_res_chain_pres frame_nil_stat_eq Commutativity Assertion_stat_eq_trans Composition Associativity)
moreover with rimp_p'' fr_p'' fr_r `A\<^sub>P'' \<sharp>* \<Psi>` `A\<^sub>R \<sharp>* \<Psi>` `A\<^sub>P'' \<sharp>* \<Psi>\<^sub>Q` `A\<^sub>R \<sharp>* \<Psi>\<^sub>Q`