Section Rule_Operators.
Variable R R' : red_rule.
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).
End Rule_Operators.
Hint Unfold R_rst reunion: pts.
Hint Resolve ctx_rule ctx_abs_l ctx_abs_r ctx_app_l ctx_app_r ctx_prod_l
ctx_prod_r: pts.
Section Context_Closure.
Variable R : red_rule.
Definition red := R_rt (ctxt R).
Definition conv := R_rst (ctxt R).
Hint Unfold red conv: pts.

(* Specifications: *)
Lemma red_trans :
forall (e : env) (x y z : term), red e x y -> red e y z -> red e x z.