Definition R_rst : red_rule :=
    fun e : env => clos_refl_sym_trans term (R e).Definition reunion : red_rule := fun e => union _ (R e) (R' e).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).(* passage au contexte *)

  Inductive ctxt : env -> term -> term -> Prop :=
    | ctx_rule : forall (e : env) (x y : term), R e x y -> ctxt e x y
    | ctx_abs_l :
        forall (e : env) (M M' : term),
        ctxt e M M' -> forall N : term, ctxt e (Abs M N) (Abs M' N)
    | ctx_abs_r :
        forall (e : env) (M M' N : term),
        ctxt (Ax N :: e) M M' -> ctxt e (Abs N M) (Abs N M')
    | ctx_app_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (App M1 M2) (App N1 M2)
    | ctx_app_r :
        forall (e : env) (M2 N2 : term),
        ctxt e M2 N2 -> forall M1 : term, ctxt e (App M1 M2) (App M1 N2)
    | ctx_prod_l :
        forall (e : env) (M1 N1 : term),
        ctxt e M1 N1 -> forall M2 : term, ctxt e (Prod M1 M2) (Prod N1 M2)
    | ctx_prod_r :
        forall (e : env) (M2 N2 M1 : term),
        ctxt (Ax M1 :: e) M2 N2 -> ctxt e (Prod M1 M2) (Prod M1 N2).Definition red := R_rt (ctxt R).Definition conv := R_rst (ctxt R).

Lemma conv_conv_prod : forall (e : env) (A A' B B' : term), conv e A A' -> conv (Ax A' :: e) B B' -> conv e (Prod A B) (Prod A' B').