(* Case 1 : stepped to the final state s1' of the inner program*)
(* Case 2 : stepped to the nextx state s12 of the inner program*)

Lemma stepWithInv W A pr I (ii : InductiveInv pr I) s1
(t : proc this (mkWorld pr) A) sc s2 (q : proc this W A) pf :
pstep s1 (WithInv pr I ii pf t) sc s2 q <->
(exists v, [/\ sc = WithInvRet, t = Ret v, q = Ret v, s2 = s1,
s1 \In Coh W & W = mkWorld (ProtocolWithIndInv ii)]) \/
exists sc' t' , [/\ sc = WithInvStep sc', q = WithInv pr I ii pf t',
W = mkWorld (ProtocolWithIndInv ii),
s1 \In Coh W & pstep s1 t sc' s2 t'].