(* Again, because [traverse] is relative, there can be several ways of writing a substitution. The following lemma states this. When used as a rewriting rule, it helps recognize applications of [subst]. *)

(* Specifications: *)
Lemma recognize_subst:
forall `{Var V, Traverse V V, Traverse V T},
@TraverseFunctorial V _ V _ ->
@TraverseIdentifiesVar V _ _ ->
@TraverseRelative V V _ ->
@TraverseRelative V T _ ->
forall traverse_,
traverse_ = traverse -> (* helps rewrite *)
forall v k2 k1 t,
traverse_ (fun l x => subst_idx (lift l 0 v) (l + k2) x) k1 t =
subst (lift k1 0 v) (k1 + k2) t.