(* Turn a vector in a list of scalar to be used for multiple product *)
Fixpoint v2l (n: nat) : vect n -> list K :=
match n return vect n -> list K with
O => fun k => k :: nil
| S n1 => fun x => let (x1, x2) := x in
(v2l n1 x1 ++ v2l n1 x2)%list
end.

(* Specifications: *)
(* The length is 2^n *)
Lemma v2l_length n v : length (v2l n v) = exp 2 n.
(* Every vector is a multiple product of all products of the base *)
Lemma mprod_2l n (v: vect n) :  v2l n v *X*  all_prods n (base n 1) = v.
(* Every vector is a linear combination of all products of the base *)
Lemma cbl_all_prods n v : cbl _ (all_prods _ (base n 1)) v.
(* Ad-hoc inductive principes for vectors *)
Lemma vect_induct n (P: vect n -> Prop) :
P (1: vect n) -> (forall v, In v (base n 1) -> P v) ->
(forall v1 v2, P v1 -> P v2 -> P (v1 ∨ v2)) ->
(forall v1 v2, P v1 -> P v2 -> P (v1 + v2)) ->
(forall k v, P v -> P (k .* v)) ->
(forall v, P v).
Lemma vect_hom_induct n (P: vect n -> Prop) :
(forall k v, hom n k v -> P v) ->
(forall v1 v2, P v1 -> P v2 -> P (v1 + v2)) ->
(forall v, P v).