Fixpoint n_to_K n := 
  match n with O => 0: p | S n => (1 + n_to_K n) end.

(* Specifications: *)
Lemma n_to_K0: n_to_K 0 = 0.
Lemma n_to_K1: n_to_K 1 = 1.
Lemma n_to_K_add m n : n_to_K (m + n) = n_to_K m + n_to_K n.
Lemma n_to_K_minus m n : n <= m -> n_to_K (m - n) = n_to_K m + -n_to_K n.
Lemma n_to_K_mult m n : n_to_K (m * n) = n_to_K m * n_to_K n.