Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Definition val_inf (n : nat) : inf n -> nat :=
Inj nat (fun x : nat => x < n).
Let Cons := cons digit.
Let Nil := nil digit.
Fixpoint Val (n : nat) (X : num n) {struct X} : nat :=
match X with
| nil => 0
| cons p xp X' => val xp * exp base p + Val p X'
end.
simpl in |- *.
intros x.
rewrite (mult_1_r (val x)).
auto.
Qed.

Lemma upper_bound : forall (n : nat) (X : num n), Val n X < exp base n.