(* Conversion from list to kn *)
Fixpoint l2kn (n:nat) (l:list K) {struct l} : kn n:=
  match n return kn n with 
  | 0 => tt 
  | S n1 => match l with 
            | nil => genk (S n1) 0%f
            | a::l1 =>  (a,l2kn n1 l1)
            end
  end.Fixpoint kn2l (n : nat) : kn n -> list K :=
  match n return (kn n -> list K) with
  | 0 => fun x => nil
  | S n1 => fun v => let (a, v1) := v in a :: kn2l n1 v1
  end.

(* Specifications: *)
Lemma kn2ll2knE n x : l2kn n (kn2l n x) = x.
Lemma genk_id0 n i : In i (kn2l n (genk n 0%f)) -> i = 0%f.