(* reduction *)

  Definition red_rule := env -> term -> term -> Prop.(* fermetures refl. trans. *)

  Definition R_rt : red_rule := fun e : env => clos_refl_trans term (R e).(* reduction dans l'environnement *)

  Inductive red_decl : env -> decl -> decl -> Prop :=
    | rd_ax :
        forall (e : env) (T U : term), R e T U -> red_decl e (Ax T) (Ax U)
    | rd_def :
        forall (e : env) (d T U : term),
        R e T U -> red_decl e (Def d T) (Def d U).(* reduction dans l'environnement *)

  Inductive red_decl : env -> decl -> decl -> Prop :=
    | rd_ax :
        forall (e : env) (T U : term), R e T U -> red_decl e (Ax T) (Ax U)
    | rd_def :
        forall (e : env) (d T U : term),
        R e T U -> red_decl e (Def d T) (Def d U).(* reduction dans l'environnement *)

  Inductive red_decl : env -> decl -> decl -> Prop :=
    | rd_ax :
        forall (e : env) (T U : term), R e T U -> red_decl e (Ax T) (Ax U)
    | rd_def :
        forall (e : env) (d T U : term),
        R e T U -> red_decl e (Def d T) (Def d U).Inductive R_in_env : env -> env -> Prop :=
    | R_env_hd :
        forall (e : env) (t u : decl),
        red_decl e t u -> R_in_env (t :: e) (u :: e)
    | R_env_tl :
        forall (e f : env) (t : decl),
        R_in_env e f -> R_in_env (t :: e) (t :: f).Inductive R_in_env : env -> env -> Prop :=
    | R_env_hd :
        forall (e : env) (t u : decl),
        red_decl e t u -> R_in_env (t :: e) (u :: e)
    | R_env_tl :
        forall (e f : env) (t : decl),
        R_in_env e f -> R_in_env (t :: e) (t :: f).Inductive R_in_env : env -> env -> Prop :=
    | R_env_hd :
        forall (e : env) (t u : decl),
        red_decl e t u -> R_in_env (t :: e) (u :: e)
    | R_env_tl :
        forall (e f : env) (t : decl),
        R_in_env e f -> R_in_env (t :: e) (t :: f).

Lemma red_item : forall (n : nat) (t : decl) (e : env), item t e n -> forall f : env, R_in_env e f -> item t f n \/ (forall g : env, trunc (S n) e g -> ex2 (fun u : decl => red_decl g t u) (fun u : decl => item u f n) /\ trunc (S n) f g).