Section Inversion_Conv.
Inductive conv_hn_inv : env -> term -> term -> Prop :=
| chi_srt : forall (e : env) (s : sort), conv_hn_inv e (Srt s) (Srt s)
| chi_ref : forall (e : env) (n : nat), conv_hn_inv e (Ref n) (Ref n)
| chi_abs :
forall (e : env) (A A' M M' : term),
conv R e A A' ->
conv R (Ax A' :: e) M M' -> conv_hn_inv e (Abs A M) (Abs A' M')
| chi_app :
forall (e : env) (u u' v v' : term),
conv R e u u' -> conv R e v v' -> conv_hn_inv e (App u v) (App u' v')
| chi_prod :
forall (e : env) (A A' B B' : term),
conv R e A A' ->
conv R (Ax A' :: e) B B' -> conv_hn_inv e (Prod A B) (Prod A' B').
Hint Resolve chi_srt chi_ref chi_abs chi_app chi_prod: pts.
simple induction 1; intros; auto with arith pts.
apply chi_abs; auto with arith pts.
apply stable_conv with (fun (_ : env) (_ x : term) => x = A) (Ax A' :: e0);
auto with arith pts.
apply chi_prod; auto with arith pts.
apply stable_conv with (fun (_ : env) (_ x : term) => x = A) (Ax A' :: e0);
auto with arith pts.
Qed.
simple induction 1; intros; auto with arith pts.
inversion_clear H2.
apply chi_abs.
apply conv_trans with A'; auto with arith pts.
apply conv_trans with M'; auto with arith pts.
apply stable_conv with (fun (_ : env) (_ x : term) => x = A'0) (Ax A' :: e0);
auto with arith pts.
inversion_clear H2.
apply chi_app.
apply conv_trans with u'; auto with arith pts.
apply conv_trans with v'; auto with arith pts.
inversion_clear H2.
apply chi_prod.
apply conv_trans with A'; auto with arith pts.
apply conv_trans with B'; auto with arith pts.
apply stable_conv with (fun (_ : env) (_ x : term) => x = A'0) (Ax A' :: e0);
auto with arith pts.
Qed.
simple induction 1.
simple induction 1; intros; auto with arith pts.
elim H2 with x1 y1; auto with arith pts.
simple destruct x0; auto with arith pts.
intros.
apply conv_hn_inv_trans with y0; auto with arith pts.
apply H3.
apply hn_red_hn with x0; auto with arith pts.
Qed.
Hint Resolve inv_red_hn: pts.

Lemma inv_conv_hn :
forall (e : env) (x y : term),
conv R e x y ->
forall x' y' : term,
red R e x x' ->
head_normal R e x' ->
red R e y y' -> head_normal R e y' -> conv_hn_inv e x' y'.