Definition rcv_transI := @ReceiveTrans _ CohI _ msg_wfI _ r_step_cohI.
End ReceiveInvWrapper.
(* The client has to provide instances of the following two structures along with the proofs of Hs and Hr. *)
Structure SendInv := SI {
st : send_trans coh;
st_inv : S_inv st;
}.
Structure ReceiveInv := RI {
rt : receive_trans coh;
rt_inv : R_inv rt;
}.
Structure InductiveInv := II {
sts : seq SendInv;
rts : seq ReceiveInv;
_ : map st sts = snd_trans p;
_ : map rt rts = rcv_trans p
}.
(* Obtain new send/receive transitions *)
Definition stsI sts := map (fun stt =>
@snd_transI (st stt) (@st_inv stt)) sts.
Definition rtsI rts := map (fun rtt =>
@rcv_transI (rt rtt) (@rt_inv rtt)) rts.
Variable ii : InductiveInv.

(* Specifications: *)
Lemma us : uniq (map (@t_snd _ _) (stsI (sts ii))).
Lemma ur : uniq (map (@t_rcv _ _) (rtsI (rts ii))).
Definition ProtocolWithIndInv := @Protocol _ l _ _ _ us ur.
Lemma stIn (s : SendInv) :
s \In (sts ii) ->
(snd_transI (@st_inv s)) \In (snd_trans ProtocolWithIndInv).