(* ------------------------------------------------------------ *)
(* tactics for substitution proofs. *)
(* Most of the substitution cases below are about showing that the term is locally closed after the substiution. This tactic takes care of that argument. *)
Ltac lc_subst_case x0 b0  :=
let x:= fresh in
lc_inversion x; subst;
try (rewrite tm_subst_tm_tm_open_tm_wrt_tm; eauto);
try (rewrite tm_subst_tm_tm_open_tm_wrt_co; eauto);
econstructor; eauto using Value_lc,
tm_subst_tm_tm_lc_tm, tm_subst_tm_co_lc_co,
tm_subst_tm_constraint_lc_constraint;
apply_lc_exists x;
eauto using tm_subst_tm_tm_lc_tm, tm_subst_tm_co_lc_co,
Value_lc, tm_subst_tm_constraint_lc_constraint;
subst_helper x x0 b0.
(* ------------------------------------------------- *)

(* Specifications: *)
Lemma subst_reduction_in_one : forall a a',
reduction_in_one a a' -> forall b x, lc_tm b ->
reduction_in_one (tm_subst_tm_tm b x a)
(tm_subst_tm_tm b x a').
Lemma E_AbsTerm_exists : ∀ x (a a' : tm),
x `notin` (fv_tm a \u fv_tm a') ->
reduction_in_one (open_tm_wrt_tm a (a_Var_f x))
(open_tm_wrt_tm a' (a_Var_f x))
→ reduction_in_one (a_UAbs Irrel a) (a_UAbs Irrel a').
(* Coerced values and values are terminal. *)
Lemma no_Value_reduction :
(forall a, Value a -> forall b, not (reduction_in_one a b)).
(* The reduction relation is deterministic *)
Lemma reduction_in_one_deterministic :
forall a a1, reduction_in_one a a1 -> forall a2, reduction_in_one a a2 -> a1 = a2.