Ltac safe_subst x := subst x.
Ltac safe_subst_any := subst_any.
(* safe_subst is meant to avoid doing rewrites or substitution of variables that are in the scope of a unification variable.  Right now, the tactic is a placeholder for real tactic that will detect the scope violation and (if so) avoid doing the substition.  See issue #186. *)
Ltac lower_one_temp_Vint' :=
match goal with
| |- (local _ && PROPx _ (LOCALx (temp _ ?v :: _) _)) _ |-- _ =>
is_var v;
simple eapply lower_one_temp_Vint';
[ reflexivity | ];
let v' := fresh "v" in rename v into v';
let tc := fresh "TC" in
intros [v [? [tc ?EVAL]]]; unfold tc_val in tc; safe_subst v';
revert tc; fancy_intro true
end.

Lemma lower_one_temp_trivial:
forall t rho Delta P i v Q R S,
(temp_types Delta) ! i = Some t ->
(tc_val t v ->
(local (tc_environ Delta) && PROPx P (LOCALx Q (SEPx R))) rho |-- S) ->
(local (tc_environ Delta) && PROPx P (LOCALx (temp i v :: Q) (SEPx R))) rho |-- S.