Section Infer_Full_PTS.
Fixpoint full_ppal_type (t : term) :
forall e : env, wf e -> infer_ppal_type e t :=
fun e H =>
match t return (infer_ppal_type e t) with
| Srt s => infer_sort e s H
| Ref n => infer_ref e n H
| Abs A M => infer_abs full_ppal_type e A M H
| App u v => infer_app full_ppal_type e u v H
| Prod A B => infer_prod full_ppal_type e A B H
end.
Proof fix_add_typ full_ppal_type.
Proof fix_chk_wk full_ppal_type.
Let add_cst : forall (e : env) (t T : term), wf e -> decl_dec e (Def t T).
(* Realizer [e:env; t,T:term] Cases (tmp_add_typ e T) of Dcl_ok => (tmp_check_typ_when_wf e t T) | (Dcl_fail err) => (Chk_fail err) end. *)
intros.
elim (tmp_add_typ e T); trivial; intros.
elim (tmp_check_typ_when_wf e t T); trivial; intros.
left.
inversion_clear w.
apply wf_cst with s; trivial with pts.
right with err; auto with pts.
inversion_clear w.
left with s; trivial with pts.
right with err; auto with pts.
Qed.

Lemma tmp_check_wf_type : forall (e : env) (t : term), wf e -> wft_dec e t.