Section ZModulo.
Variable digits : positive.
Hypothesis digits_ne_1 : digits <> 1%positive.
Definition wB := base digits.
Definition t := Z.
Definition zdigits := Zpos digits.
Definition to_Z x := x mod wB.
Notation "[| x |]" := (to_Z x)  (at level 0, x at level 99).
Notation "[+| c |]" :=
(interp_carry 1 wB to_Z c)  (at level 0, c at level 99).
Notation "[-| c |]" :=
(interp_carry (-1) wB to_Z c)  (at level 0, c at level 99).
Notation "[|| x ||]" :=
(zn2z_to_Z wB to_Z x)  (at level 0, x at level 99).
Let digits_gt_1 := spec_more_than_1_digit.
Hint Resolve wB_pos : core.
Hint Resolve spec_to_Z_1 spec_to_Z_2 : core.

Lemma spec_to_Z : forall x, 0 <= [|x|] < wB.