Local Ltac t := solve [right; intros []; intros; breakhyps].Ltac t' i cnti :=
      right; intros [i']; intros [cnti']; intros ?; breakhyps;
      try (assert (i' = i) by congruence; subst i');
      try (assert (cnti' = cnti) by apply proof_irr; subst cnti');
      breakhyps.

Lemma invariant_safe Gamma n state : inv Gamma n state -> jmsafe (globalenv prog) n state.