(* Equality to zero: Equality to zero on leaves *)
Notation "x ?= 0" := (eq0 _ x) (at level 70): g_scope.

(* Specifications: *)
(* Equality to zero *)
Lemma eq0_dec n (x: vect n) : if x ?= 0 then x = 0 else x <> 0.
Lemma eq0_spec n (x: vect n) : eq_Spec x 0 (x ?= 0).
Lemma en_def n : 'e_n = 1 :> vect n.
Lemma addk n k1 k2 : [k1] + [k2] = [k1 + k2] :> vect n.
(* scal is integral *)
Lemma scal_integral n k (x: vect n) : k .* x = 0 -> k = 0%f \/ x = 0.
(* Multiplication of a constant *)
Lemma scalk n k1 k2 : k1 .* [k2] = [k1 * k2] :> vect n.
Fixpoint hom (n k : nat) {struct n} : vect n -> bool :=
match n return (vect n -> bool) with
| 0%nat => fun a => match k with O => true | S _ => a ?= 0 end
| S n1 =>
fun l1 =>
let (l2, l3) := l1 in
(match k with O => l2 ?= 0 | S k1 => hom n1 k1 l2 end) && hom n1 k l3
end.