Ltac simpl_of_lu :=
  match goal with
  | |- context [ of_lu (?f ?x) ] =>
    rewrite (of_lu_eqn (f x)); simpl hd; simpl tl
  end.

(* Specifications: *)
Lemma of_lu_succ d : of_lu (Little.succ d) = S (of_lu d).
Lemma of_to_lu n : of_lu (to_lu n) = n.
Lemma of_lu_revapp d d' : of_lu (revapp d d') = of_lu (rev d) + of_lu d' * 0x10^usize d.
Lemma of_uint_acc_spec n d : Nat.of_hex_uint_acc d n = of_lu (rev d) + n * 0x10^usize d.
Lemma of_uint_alt d : Nat.of_hex_uint d = of_lu (rev d).
Lemma of_to (n:nat) : Nat.of_hex_uint (Nat.to_hex_uint n) = n.
Lemma to_lu_sixteenfold n : n<>0 -> to_lu (0x10 * n) = D0 (to_lu n).
Lemma of_lu_0 d : of_lu d = 0 <-> nztail d = Nil.
Lemma to_of_lu_sixteenfold d : to_lu (of_lu d) = lnorm d -> to_lu (0x10 * of_lu d) = lnorm (D0 d).
Lemma to_of_lu d : to_lu (of_lu d) = lnorm d.
Lemma to_of (d:uint) : Nat.to_hex_uint (Nat.of_hex_uint d) = unorm d.
Lemma to_uint_inj n n' : Nat.to_hex_uint n = Nat.to_hex_uint n' -> n = n'.
Lemma to_uint_surj d : exists n, Nat.to_hex_uint n = unorm d.
Lemma of_uint_norm d : Nat.of_hex_uint (unorm d) = Nat.of_hex_uint d.
Lemma of_inj d d' : Nat.of_hex_uint d = Nat.of_hex_uint d' -> unorm d = unorm d'.
Lemma of_iff d d' : Nat.of_hex_uint d = Nat.of_hex_uint d' <-> unorm d = unorm d'.
Lemma of_to (n:nat) : Nat.of_hex_int (Nat.to_hex_int n) = Some n.
Lemma to_of (d:int)(n:nat) : Nat.of_hex_int d = Some n -> Nat.to_hex_int n = norm d.
Lemma to_int_inj n n' : Nat.to_hex_int n = Nat.to_hex_int n' -> n = n'.
Lemma to_int_pos_surj d : exists n, Nat.to_hex_int n = norm (Pos d).
Lemma of_int_norm d : Nat.of_hex_int (norm d) = Nat.of_hex_int d.
Lemma of_inj_pos d d' : Nat.of_hex_int (Pos d) = Nat.of_hex_int (Pos d') -> unorm d = unorm d'.
Lemma of_lu_succ d : of_lu (Little.succ d) = S (of_lu d).
Lemma of_to_lu n : of_lu (to_lu n) = n.
Lemma of_lu_revapp d d' : of_lu (revapp d d') = of_lu (rev d) + of_lu d' * 10^usize d.
Lemma of_uint_acc_spec n d : Nat.of_uint_acc d n = of_lu (rev d) + n * 10^usize d.
Lemma of_uint_alt d : Nat.of_uint d = of_lu (rev d).
Lemma of_to (n:nat) : Nat.of_uint (Nat.to_uint n) = n.
Lemma to_lu_tenfold n : n<>0 -> to_lu (10 * n) = D0 (to_lu n).
Lemma of_lu_0 d : of_lu d = 0 <-> nztail d = Nil.
Lemma to_of_lu_tenfold d : to_lu (of_lu d) = lnorm d -> to_lu (10 * of_lu d) = lnorm (D0 d).
Lemma to_of_lu d : to_lu (of_lu d) = lnorm d.
Lemma to_of (d:uint) : Nat.to_uint (Nat.of_uint d) = unorm d.
Lemma to_uint_inj n n' : Nat.to_uint n = Nat.to_uint n' -> n = n'.
Lemma to_uint_surj d : exists n, Nat.to_uint n = unorm d.
Lemma of_uint_norm d : Nat.of_uint (unorm d) = Nat.of_uint d.
Lemma of_inj d d' : Nat.of_uint d = Nat.of_uint d' -> unorm d = unorm d'.
Lemma of_iff d d' : Nat.of_uint d = Nat.of_uint d' <-> unorm d = unorm d'.
Lemma of_to (n:nat) : Nat.of_int (Nat.to_int n) = Some n.
Lemma to_of (d:int)(n:nat) : Nat.of_int d = Some n -> Nat.to_int n = norm d.
Lemma to_int_inj n n' : Nat.to_int n = Nat.to_int n' -> n = n'.
Lemma to_int_pos_surj d : exists n, Nat.to_int n = norm (Pos d).
Lemma of_int_norm d : Nat.of_int (norm d) = Nat.of_int d.
Lemma of_inj_pos d d' : Nat.of_int (Pos d) = Nat.of_int (Pos d') -> unorm d = unorm d'.