Section ConstantSubstitution.
Implicit Types (X Y Z : Const).
Fixpoint subst_consts {X Y} (kappa: X -> exp Y) s :=
match s with
| var x => var x
| const c => kappa c
| lambda s => lambda (subst_consts (kappa >> ren shift) s)
| app s t => (subst_consts kappa s) (subst_consts kappa t)
end.

Lemma ren_subst_consts_commute X Y (zeta: X -> exp Y) delta s:
subst_consts (zeta >> ren delta) (ren delta s) = ren delta (subst_consts zeta s).