Arguments aftA [A B s p P].
Arguments aftI [A s p P Q].
End Always.
Section AlwaysInject.
Variables (V W : world) (K : hooks) (A : Type) (w : injects V W K) (this: nid).
Notation W2 := (inj_ext w).

(* Specifications: *)
Lemma rely_ext i j s :
i \In Coh V ->
network_rely W this (i \+ j) s ->
exists i' j', s = i' \+ j' /\ i' \In Coh V.
Lemma rely_split' z s1 s1' s2 s2' :
s1 \In Coh V -> s2 \In Coh V ->
network_step W z (s1 \+ s1') (s2 \+ s2') ->
network_step V z s1 s2 /\ network_step (inj_ext w) z s1' s2'.
Lemma rely_split s1 s1' s2 s2' :
s1 \In Coh V -> s2 \In Coh V ->
network_rely W this (s1 \+ s1') (s2 \+ s2') ->
network_rely V this s1 s2 /\ network_rely (inj_ext w) this s1' s2'.
Lemma alw_inject (p : proc this V A)
(P : state -> proc this V A -> Prop) i j :
i \+ j \In Coh W ->
always i p P ->
always (i \+ j) (Inject w p)
(fun m q => exists i' j',
[/\ m = i' \+ j', i' \In Coh V, network_rely W2 this j j' &
(exists q', q = Inject w q' /\ P i' q') \/
(exists v', q = Ret v' /\ P i' (Ret v'))]).
Lemma aft_inject (p : proc this V A) (P : A -> state -> Prop) i j :
i \+ j \In Coh W ->
after i p P ->
after (i \+ j) (Inject w p)
(fun v m => exists i' j',
[/\ m = i' \+ j', i' \In Coh V,
network_rely W2 this j j' & P v i']).