End Inject.
From DiSeL
Section InductiveInv.
Variable pr : protocol.
(* Decompose the initial protocol *)
Notation l := (plab pr).
Notation coh := (coh pr).
Variable I : dstatelet -> pred nid -> Prop.
Variable ii : InductiveInv pr I.
(* Tailored modal always-lemma *)
Variables (A : Type) (this: nid).
Notation V := (mkWorld pr).
Notation W := (mkWorld (ProtocolWithIndInv ii)).
Variable (e : DT this V A).
Notation s := (spec_of e).
Section Prog.
Variable T : prog V A this.
Definition with_inv_set t :=
t = Unfinished \/ exists t', t' \In T /\ t = WithInv pr I ii (erefl _) t'.
Definition with_inv_prog := @Prog _ _ _ with_inv_set (or_introl (erefl _)).
End Prog.
Notation getS i := (getStatelet i l).
Definition with_inv_s : spec A :=
(fun i => s.1 i,
fun i y m => m \In Coh W /\ s.2 i y m).

Lemma with_inv_has_spec : with_inv_prog (code_of e) \In has_spec this W with_inv_s.
Definition with_inv := with_spec (DTbin_make with_inv_has_spec).