(* Realizer [e:env; t:term] Cases (whnf e t) of (Srt s) => (inleft ? s) | _ => (inright sort) end. *)
intros.
case (whnf e t); auto with pts.
simple destruct x; intros.
left; exists s.
split; simpl in |- *; intros.
auto with arith pts.
replace (R_rt cumul) with (Rule (Le_type (pts_le_type cts_pts_functor)));
trivial with arith pts.
apply sub_sort_env_indep with e; simpl in |- *.
apply cumul_trans with t; auto 10 with arith pts.
right; red in |- *; intros.
cut (cumul_hn_inv e (Ref n) (Srt x0)); intros.
inversion_clear H1.
apply inv_cumul_hn with t (Srt x0); auto with arith pts.
right; red in |- *; intros.
cut (cumul_hn_inv e (Abs t0 t1) (Srt x0)); intros.
inversion_clear H1.
apply inv_cumul_hn with t (Srt x0); auto with arith pts.
right; red in |- *; intros.
cut (cumul_hn_inv e (App t0 t1) (Srt x0)); intros.
inversion_clear H1.
apply inv_cumul_hn with t (Srt x0); auto with arith pts.
right; red in |- *; intros.
cut (cumul_hn_inv e (Prod t0 t1) (Srt x0)); intros.
inversion_clear H1.
apply inv_cumul_hn with t (Srt x0); auto with arith pts.
Qed.

Lemma cumul_least_prod :
forall (e : env) (t : term),
wf_type cts_pts_functor e t -> red_to_wf_prod_dec cts_pts_functor e t.