Kind name,label,proc type.
Set subgoals off.
Import "pic_core".
%%% Bisimulation up to bisimilarity
Define bisim_t : proc -> proc -> proc -> proc -> prop by
bisim_t P1 P2 Q1 Q2 :=
bisim_up_to refl_t P1 P2 /\ bisim_up_to refl_t Q1 Q2.
Define is_sound_fst : (proc -> proc -> proc -> proc -> prop) -> prop by
is_sound_fst Tech := forall P Q,
(exists R S, bisim_up_to refl_t P R /\ bisim_up_to Tech R S
/\ bisim_up_to refl_t S Q)
-> bisim_up_to refl_t P Q.
Define is_sound_snd : (proc -> proc -> proc -> proc -> prop) -> prop by
is_sound_snd Tech := forall P Q, bisim_up_to Tech P Q ->
exists R S, bisim_up_to refl_t P R /\ bisim_up_to Tech R S
/\ bisim_up_to refl_t S Q.
Theorem bisim_t_reflexive : forall P, bisim_t P P P P.
intros. unfold.
- backchain bisim_reflexive.
- backchain bisim_reflexive.
Theorem bisim_sound_fst : is_sound_fst bisim_t.
unfold. CH : coinduction. intros !P !Q Hexists.
!R !S Hleft Hmid Hright : case Hexists. unfold.
- intros !L !PstepRes Pstep.
Left1* : case Hleft. Rstep* : apply *Left1 to *Pstep.
clear Left2 Left3 Left4 Left5 Left6.
Middle1* : case Hmid. Sstep* : apply *Middle1 to *Rstep.
clear Middle2 Middle3 Middle4 Middle5 Middle6.
Right1* : case Hright.
!QstepFinal Qstep* : apply *Right1 to *Sstep.
clear Right2 Right3 Right4 Right5 Right6.
witness QstepFinal. split.
+ search.
+ clear Qstep.
witness PstepRes. witness QstepFinal. split.
* search.
* case Rstep1. case Qstep1. Sstep1* : case Sstep1.
Link1* : apply bisim_transitive to *Rstep2 *Sstep1.
Link1* : apply bisim_symmetric to *Sstep3.
Link1* : apply bisim_transitive to *Link2 *Qstep2.
backchain *CH.
- intros !X !PdnRes Pstep.
Left1* : case Hleft. Rstep* : apply *Left2 to *Pstep.
clear Left1 Left3 Left4 Left5 Left6.
Middle1* : case Hmid. Sstep* : apply *Middle2 to *Rstep.
clear Middle1 Middle3 Middle4 Middle5 Middle6.
Right1* : case Hright.
!QdnFinal Qstep* : apply *Right2 to *Sstep.
clear Right1 Right3 Right4 Right5 Right6.
witness QdnFinal. split.
+ search.
+ clear Qstep.
witness PdnRes. witness QdnFinal. intros !Nmsg. split.
* search.
* Before* : apply *Rstep1 with N = Nmsg. Eq1* : case Before.
Tech* : apply *Sstep1 with N = Nmsg. Bis1* : case Tech.
After* : apply *Qstep1 with N = Nmsg. Eq1* : case After.
Before* : apply bisim_eq_1R to *Before1 *Eq2.
Before* : apply bisim_eq_2R to *Before *Eq1.
Before* : apply bisim_transitive to *Before *Bis1.
After* : apply bisim_eq_2R to *After1 *Eq3.
Link* : apply bisim_symmetric to *Bis2.
Link* : apply bisim_eq_2L to *Link *Eq4.
After* : apply bisim_transitive to *Link *After.
backchain *CH.
- intros !X !PupRes Pstep.
Left1* : case Hleft. Rstep* : apply *Left3 to *Pstep.
clear Left1 Left2 Left4 Left5 Left6.
Middle1* : case Hmid. Sstep* : apply *Middle3 to *Rstep.
clear Middle1 Middle2 Middle4 Middle5 Middle6.
Right1* : case Hright.
!QupFinal Qstep* : apply *Right3 to *Sstep.
clear Right1 Right2 Right4 Right5 Right6.
witness QupFinal. split.
+ search.
+ clear Qstep.
witness PupRes. witness QupFinal. intros. split.
* search.
* case Rstep1. case Qstep1. Tech1* : case Sstep1.
Before* : apply bisim_transitive to *Rstep2 *Tech1.
After* : apply bisim_symmetric to *Tech2.
After* : apply bisim_transitive to *After *Qstep2.
backchain *CH.
- intros !L !QstepRes Qstep.
Right1* : case Hright. Sstep* : apply *Right4 to *Qstep.
clear Right1 Right2 Right3 Right5 Right6.
Middle1* : case Hmid. Rstep* : apply *Middle4 to *Sstep.
clear Middle1 Middle2 Middle3 Middle5 Middle6.
Left1* : case Hleft.
!PstepFinal Pstep* : apply *Left4 to *Rstep.
clear Left1 Left2 Left3 Left5 Left6.
witness PstepFinal. split.
+ search.
+ clear Pstep.
witness PstepFinal. witness QstepRes. split.
* search.
* case Sstep1. case Pstep1. Tech1* : case Rstep1.
Before* : apply bisim_transitive to *Pstep2 *Tech1.
Link* : apply bisim_symmetric to *Tech2.
After* : apply bisim_transitive to *Link *Sstep2.
backchain *CH.
- intros !X !QdnRes Qstep.
Right1* : case Hright. Sstep* : apply *Right5 to *Qstep.
clear Right1 Right2 Right3 Right4 Right6.
Middle1* : case Hmid. Rstep* : apply *Middle5 to *Sstep.
clear Middle1 Middle2 Middle3 Middle4 Middle6.
Left1* : case Hleft.
!PdnFinal Pstep* : apply *Left5 to *Rstep.
clear Left1 Left2 Left3 Left4 Left6.
witness PdnFinal. split.
+ search.
+ clear Pstep.
witness PdnFinal. witness QdnRes. intros !Nmsg. split.
* search.
* After* : apply *Sstep1 with N = Nmsg. Eq1* : case After.
Link* : apply *Rstep1 with N = Nmsg. Bis1* : case Link.
Before* : apply *Pstep1 with N = Nmsg. Eq1* : case Before.
Before* : apply bisim_eq_1R to *Before1 *Eq4.
Before* : apply bisim_eq_2R to *Before *Eq3.
Before* : apply bisim_transitive to *Before *Bis1.
Bis2* : apply bisim_symmetric to *Bis2.
Bis2* : apply bisim_eq_2L to *Bis2 *Eq2.
After* : apply bisim_eq_2R to *After1 *Eq1.
After* : apply bisim_transitive to *Bis2 *After.
backchain *CH.
- intros !X !QupRes Qstep.
Right1* : case Hright. Sstep* : apply *Right6 to *Qstep.
clear Right1 Right2 Right3 Right4 Right5.
Middle1* : case Hmid. Rstep* : apply *Middle6 to *Sstep.
clear Middle1 Middle2 Middle3 Middle4 Middle5.
Left1* : case Hleft.
!PupFinal Pstep* : apply *Left6 to *Rstep.
clear Left1 Left2 Left3 Left4 Left5.
witness PupFinal. split.
+ search.
+ clear Pstep.
witness PupFinal. witness QupRes. intros. split.
* search.
* case Sstep1. case Pstep1. Tech1* : case Rstep1.
Before* : apply bisim_transitive to *Pstep2 *Tech1.
Tech2* : apply bisim_symmetric to *Tech2.
After* : apply bisim_transitive to *Tech2 *Sstep2.
backchain *CH.
Theorem bisim_sound_snd : is_sound_snd bisim_t.
unfold. intros !P !Q _. witness P. witness Q. split.
- backchain bisim_reflexive.
- search.
- backchain bisim_reflexive.
Theorem bisim_sound : is_sound bisim_t.
Fst* : apply bisim_sound_fst. Fst* : case Fst.
Snd* : apply bisim_sound_snd. Snd* : case Snd.
unfold. intros PQ.
apply *Snd to *PQ. backchain Fst.