intros.
inversion_clear H; exists s; auto with arith pts.
Qed.

(* Specifications: *)
Theorem wf_sort :
forall (e : env) (n : nat) (d : decl),
item d e n ->
wf e ->
forall f : env,
trunc (S n) e f -> exists s : _, typ f (typ_of_decl d) (Srt s).
Theorem wf_definition :
forall (n : nat) (e : env) (m t : term),
item (Def m t) e n -> wf e -> forall f : env, trunc (S n) e f -> typ f m t.
Theorem wf_sort :
forall (e : env) (n : nat) (d : decl),
item d e n ->
wf e ->
forall f : env,
trunc (S n) e f -> exists s : _, typ f (typ_of_decl d) (Srt s).
Theorem wf_definition :
forall (n : nat) (e : env) (m t : term),
item (Def m t) e n -> wf e -> forall f : env, trunc (S n) e f -> typ f m t.