(* ----- preservation of erasure under substitution ---------- *)

(* Specifications: *)
Theorem erase_subst_mutual a x :
(∀ A B,       erase_tm A = erase_tm B ->
erase_tm (tm_subst_tm_tm a x A) = erase_tm (tm_subst_tm_tm a x B))
∧
(∀ Bs1 Bs2,   erase_brs Bs1 = erase_brs Bs2 ->
erase_brs (tm_subst_tm_brs a x Bs1) =
erase_brs (tm_subst_tm_brs a x Bs2))
∧
(∀ g1 g2 : co, True)
∧
(∀ phi1 phi2, erase_constraint phi1 = erase_constraint phi2 ->
erase_constraint (tm_subst_tm_constraint a x phi1) =
erase_constraint (tm_subst_tm_constraint a x phi2)).
Corollary erase_subst_constraint phi1 phi2 a x :
erase_constraint phi1 = erase_constraint phi2 ->
erase_constraint (tm_subst_tm_constraint a x phi1) =
erase_constraint (tm_subst_tm_constraint a x phi2).
Corollary erase_co_subst_constraint phi1 phi2 a x :
erase_constraint phi1 = erase_constraint phi2 ->
erase_constraint (co_subst_co_constraint a x phi1) =
erase_constraint (co_subst_co_constraint a x phi2).
Lemma lc_tm_erase : (forall a, lc_tm a -> lc_tm (erase a)).
intros. eapply lc_erase. auto. Qed.
Lemma lc_brs_erase : (forall b, lc_brs b -> lc_brs (erase b)).
intros. eapply lc_erase. auto. Qed.
Lemma lc_constraint_erase : (forall b, lc_constraint b -> lc_constraint (erase b)).
intros. eapply lc_erase. auto. Qed.