(* Our final vector *)
Definition Kn := kn p.
Definition K0 := genk p 0%f.
Definition Keq: Kn -> Kn -> bool := eq p.
Definition Kadd: Kn -> Kn -> Kn := add p.
Definition Kscal: K -> Kn -> Kn := scal p.
Definition Kproj: nat -> Kn -> K := proj p.
Definition Ksprod: Kn -> Kn -> K := pscal p.
Definition Kgen := gen p.
Canonical Structure v_eparams :=
Build_eparams Kn K K0 Keq Kadd Kscal.
Definition f : vparamsProp v_eparams := fn p.
(* Prod of two vectors as list *)
Fixpoint kprod (n : nat) : kn n -> kn n -> kn n :=
match n with
| 0%nat => fun a b => tt
| S n1 =>
fun l1 l2 =>
let (v1, l3) := l1 in
let (v2, l4) := l2 in ((v1 * v2)%f, kprod n1 l3 l4)
end.
Local Notation "a  [*]  b" := (kprod _ a b) (at level 40).

(* Specifications: *)
Lemma kprod0l n a : 0 [*] a = 0 :> kn n.
Lemma kprod0r n a : a [*] 0 = 0 :> kn n.
Lemma kprodkl n k a : [k] [*] a = k .* a :> kn n.
Lemma kprodkr n k a : a [*] [k] = k .* a :> kn n.
Lemma kprod1l n a : [1%f] [*] a = a :> kn n.
Lemma kprod1r n a : a [*] [1%f] = a :> kn n.
Lemma kprod_addl n a b c :
(a + b) [*] c = a [*] c + b [*] c :> kn n.
Lemma kprod_addr n a b c :
a [*] (b + c) = a [*] b + a [*] c :> kn n.
Lemma kprod_scall n k a b :
(k .* a) [*] b = k .* (a [*] b) :> kn n.
Lemma kprod_scalr n k a b :
a [*] (k .* b) = k .* (a [*] b) :> kn n.
Lemma kprod_assoc n a b c :
(a [*] b) [*] c = a [*] (b [*] c) :> kn n.