Definition Nadd n p :=
  match n with
  | N0 => p
  | Npos p0 => (p0+p)%positive
  end.

(* Specifications: *)
Lemma Nadd_simpl n p q : Npos (Nadd n (p * q)) = n + Npos p * Npos q.
Lemma of_uint_acc_eqn d acc : d<>Nil -> Pos.of_uint_acc d acc = Pos.of_uint_acc (tl d) (Nadd (hd d) (10*acc)).
Lemma of_uint_acc_rev d acc : Npos (Pos.of_uint_acc d acc) = of_lu (rev d) + (Npos acc) * 10^usize d.
Lemma of_uint_alt d : Pos.of_uint d = of_lu (rev d).
Lemma of_lu_rev d : Pos.of_uint (rev d) = of_lu d.
Lemma of_lu_double_gen d : of_lu (Little.double d) = N.double (of_lu d) /\ of_lu (Little.succ_double d) = N.succ_double (of_lu d).
Lemma of_lu_double d : of_lu (Little.double d) = N.double (of_lu d).
Lemma of_lu_succ_double d : of_lu (Little.succ_double d) = N.succ_double (of_lu d).
Lemma of_to (p:positive) : Pos.of_uint (Pos.to_uint p) = Npos p.
Lemma Nadd_simpl n p q : Npos (Nadd n (p * q)) = n + Npos p * Npos q.
Lemma of_uint_acc_eqn d acc : d<>Nil -> Pos.of_hex_uint_acc d acc = Pos.of_hex_uint_acc (tl d) (Nadd (hd d) (0x10*acc)).
Lemma of_uint_acc_rev d acc : Npos (Pos.of_hex_uint_acc d acc) = of_lu (rev d) + (Npos acc) * 0x10^usize d.
Lemma of_uint_alt d : Pos.of_hex_uint d = of_lu (rev d).
Lemma of_lu_rev d : Pos.of_hex_uint (rev d) = of_lu d.
Lemma of_lu_double_gen d : of_lu (Little.double d) = N.double (of_lu d) /\ of_lu (Little.succ_double d) = N.succ_double (of_lu d).
Lemma of_lu_double d : of_lu (Little.double d) = N.double (of_lu d).
Lemma of_lu_succ_double d : of_lu (Little.succ_double d) = N.succ_double (of_lu d).
Lemma of_to (p:positive) : Pos.of_hex_uint (Pos.to_hex_uint p) = Npos p.