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.

Lemma retype_Arr n L A:
retype_type n (Arr L A) = Arr (retype_ctx n L) (retype_type n A).