Section Order.
Fixpoint ord A :=
match A with
| typevar beta => 1
| A → B => max (S (ord A)) (ord B)
end.
Fixpoint ord' Gamma :=
match Gamma with
| nil => 0
| A :: Gamma => max (ord A) (ord' Gamma)
end.

Lemma ord'_cons n Gamma A:
ord A < n -> ord' Gamma <= n -> ord' (A :: Gamma) <= n.