(** *** Dependent products (restricted version) *)

(** This is a restricted version of [forall_rel] with [E] in [Prop],
  when the codomain relation only depends on the arguments. *)

Definition forallp_rel {V1 V2} (E: rel V1 V2) {FV1: V1->Type} {FV2: V2->Type}:
    (forall v1 v2, rel (FV1 v1) (FV2 v2)) ->
    rel (forall v1, FV1 v1) (forall v2, FV2 v2) :=
  fun FE f g =>
    forall v1 v2, E v1 v2 -> FE v1 v2 (f v1) (g v2).Notation "'forallr' v1 v2 : E , R" :=
  (forallp_rel E (fun v1 v2 => R))
  (at level 200, v1 ident, v2 ident, right associativity)
  : rel_scope.

Lemma forallp_rintro {V1 V2} {E: rel V1 V2} {F1 F2} (FE: forall v1 v2, rel _ _) f g: RIntro (forall v1 v2, E v1 v2 -> FE v1 v2 (f v1) (g v2)) (@forallp_rel V1 V2 E F1 F2 FE) f g.