(* this suggest capturing the pattern by means of a new definition *)
Definition after A s (p : proc A) (P : A -> state -> Prop) :=
always s p (fun s2 p2 => forall v, p2 = Ret v -> P v s2).

(* Specifications: *)
Lemma aft_bnd A B (p1 : proc A) (p12 : proc B) pp2 s1 P :
p12 \In pcat p1 pp2 ->
after s1 p1 (fun v s =>
forall p, p \In pp2 v -> after s p P) ->
after s1 p12 P.
Lemma aftI A s (p : proc A) (P : Prop) (Q : A -> state -> Prop) :
alwsafe s p ->
after s p (fun v s' => P -> Q v s') <->
(P -> after s p (fun v s' => Q v s')).
Lemma aft_alwsf A s (p : proc A) :
alwsafe s p <-> after s p (fun v s => True).