Section Retyping.
Variable (X: Const).
Arguments s₀ {_} {_} _.
Arguments t₀ {_} {_} _.
Arguments Gamma₀ {_} {_} _.
Arguments A₀ {_} {_} _.
Definition retype_ctx (n: nat) (Gamma : ctx) :=
map (fun A => if dec2 le (ord A) n then A else alpha) Gamma.
Fixpoint retype_type (n: nat) (A : type) :=
match A with
| typevar beta => typevar beta
| A → B => (if dec2 le (ord A) n then A else alpha) → retype_type n B
end.
Program Instance retype n (I: orduni n X) : orduni n X :=
{ Gamma₀ := retype_ctx n (Gamma₀ I);
s₀ := eta₀ (s₀ I) H1₀;
t₀ := eta₀ (t₀ I) H2₀;
A₀ := retype_type n (A₀ I) }.
Next Obligation.
eapply normal_retyping. all: eauto using eta₀_normal, eta₀_typing.
Qed.
Next Obligation.
eapply normal_retyping. all: eauto using eta₀_normal, eta₀_typing.
Qed.

Lemma retype_iff n (I: orduni n X):
1 <= n -> OU n X I <-> OU n X (@retype n I).