Fixpoint hlist_Forall ls (hs : hlist P ls) : Forall P ls :=
    match hs with
    | Hnil => Forall_nil _
    | Hcons _ _ H hs' => Forall_cons _ H (hlist_Forall hs')
    end.Inductive hlist_hrel : forall ls, hlist F ls -> hlist G ls -> Prop :=
  | hrel_Hnil : hlist_hrel Hnil Hnil
  | hrel_Hcons : forall t ts x y xs ys, @R t x y -> @hlist_hrel ts xs ys ->
                                        @hlist_hrel (t :: ts) (Hcons x xs) (Hcons y ys).Inductive hlist_hrel : forall ls, hlist F ls -> hlist G ls -> Prop :=
  | hrel_Hnil : hlist_hrel Hnil Hnil
  | hrel_Hcons : forall t ts x y xs ys, @R t x y -> @hlist_hrel ts xs ys ->
                                        @hlist_hrel (t :: ts) (Hcons x xs) (Hcons y ys).Inductive hlist_hrel : forall ls, hlist F ls -> hlist G ls -> Prop :=
  | hrel_Hnil : hlist_hrel Hnil Hnil
  | hrel_Hcons : forall t ts x y xs ys, @R t x y -> @hlist_hrel ts xs ys ->
                                        @hlist_hrel (t :: ts) (Hcons x xs) (Hcons y ys).

(* Specifications: *)
Theorem hlist_hrel_map : forall ls xs ys, @hlist_hrel A F G R ls xs ys -> @hlist_hrel A F' G' R' ls (hlist_map ff xs) (hlist_map gg ys).
Theorem hlist_hrel_cons : forall l ls x xs y ys, @hlist_hrel A F G R (l :: ls) (Hcons x xs) (Hcons y ys) -> @R l x y /\ @hlist_hrel A F G R ls xs ys.
Theorem hlist_hrel_app : forall l ls x xs y ys, @hlist_hrel A F G R (l ++ ls) (hlist_app x xs) (hlist_app y ys) -> @hlist_hrel A F G R l x y /\ @hlist_hrel A F G R ls xs ys.
Theorem hlist_hrel_equiv : forall T (F : T -> Type) (R : forall t, F t -> F t -> Prop) ls (h h' : hlist F ls), hlist_hrel R h h' -> equiv_hlist R h h'.
Theorem hlist_hrel_flip : forall T (F G : T -> Type) (R : forall t, F t -> G t -> Prop) ls (h : hlist F ls) (h' : hlist G ls), hlist_hrel R h h' -> hlist_hrel (fun t a b => R t b a) h' h.