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 compact_prod_proj_gen: forall {A: Type} {F: A -> Type} {l: list A} a d (gen: forall a, F a) (H: forall a b : A, {a = b} + {a <> b}),
In a l ->
proj_compact_prod a l (compact_prod_gen gen l) d H = gen a.