Section type.
Variable eqv : forall x, type (F x).
Global Instance type_hlist (ls : list iT): type (hlist ls) :=
{ equal := @equiv_hlist (fun x => @equal _ (eqv x)) ls
; proper :=
(fix recur ls (h : hlist ls) : Prop :=
match h with
| Hnil => True
| Hcons _ _ x y => proper x /\ recur _ y
end) ls
}.
Variable eqvOk : forall x, typeOk (eqv x).
Global Instance typeOk_hlist (ls : list iT): typeOk (type_hlist ls).
Global Instance proper_hlist_app l l' : proper (@hlist_app l l').
Fixpoint hlist_split ls ls' : hlist (ls ++ ls') -> hlist ls * hlist ls' :=
match ls as ls return hlist (ls ++ ls') -> hlist ls * hlist ls' with
| nil => fun h => (Hnil, h)
| l :: ls => fun h =>
let (a,b) := @hlist_split ls ls' (hlist_tl h) in
(Hcons (hlist_hd h) a, b)
end.
End type.

Lemma hlist_tl_snd_hlist_split
: forall t (xs ys : list _) (h : hlist (t :: xs ++ ys)),
snd (hlist_split xs ys (hlist_tl h)) =
snd (hlist_split (t :: xs) ys h).