Fixpoint compact_prod (T: list Type): Type :=
match T with
| nil => unit
| t :: nil => t
| t :: T0 => (t * compact_prod T0)%type
end.
Fixpoint compact_sum (T: list Type): Type :=
match T with
| nil => unit
| t :: nil => t
| t :: T0 => (t + compact_sum T0)%type
end.
Definition compact_prod_gen {A} {F} (gen: forall a: A, F a) (l: list A): compact_prod (map F l).

Lemma upd_compact_prod_JMeq: forall A i (l: list A) {F1: A -> Type} {F2: A -> Type} d1 d2 (v1: compact_prod (map F1 l)) (v2: compact_prod (map F2 l)) H,
(forall i, In i l -> @eq Type (F1 i) (F2 i)) ->
JMeq d1 d2 ->
JMeq v1 v2 ->
JMeq (upd_compact_prod l v1 i d1 H) (upd_compact_prod l v2 i d2 H).