Definition Zdigit n k := Z.rem (Z.quot n (Zpower beta k)) beta.

(* Specifications: *)
Theorem Zdigit_lt : forall n k, (k < 0)%Z -> Zdigit n k = Z0.
Theorem Zdigit_0 : forall k, Zdigit 0 k = Z0.
Theorem Zdigit_opp : forall n k, Zdigit (-n) k = Zopp (Zdigit n k).
Theorem Zdigit_ge_Zpower_pos : forall e n, (0 <= n < Zpower beta e)%Z -> forall k, (e <= k)%Z -> Zdigit n k = Z0.
Theorem Zdigit_ge_Zpower : forall e n, (Zabs n < Zpower beta e)%Z -> forall k, (e <= k)%Z -> Zdigit n k = Z0.
Theorem Zdigit_not_0_pos : forall e n, (0 <= e)%Z -> (Zpower beta e <= n < Zpower beta (e + 1))%Z -> Zdigit n e <> Z0.
Theorem Zdigit_not_0 : forall e n, (0 <= e)%Z -> (Zpower beta e <= Zabs n < Zpower beta (e + 1))%Z -> Zdigit n e <> Z0.
Theorem Zdigit_mul_pow : forall n k k', (0 <= k')%Z -> Zdigit (n * Zpower beta k') k = Zdigit n (k - k').
Theorem Zdigit_div_pow : forall n k k', (0 <= k)%Z -> (0 <= k')%Z -> Zdigit (Z.quot n (Zpower beta k')) k = Zdigit n (k + k').
Theorem Zdigit_mod_pow : forall n k k', (k < k')%Z -> Zdigit (Z.rem n (Zpower beta k')) k = Zdigit n k.
Theorem Zdigit_mod_pow_out : forall n k k', (0 <= k' <= k)%Z -> Zdigit (Z.rem n (Zpower beta k')) k = Z0.
Theorem Zdigit_lt : forall n k, (k < 0)%Z -> Zdigit n k = Z0.
Theorem Zdigit_0 : forall k, Zdigit 0 k = Z0.
Theorem Zdigit_opp : forall n k, Zdigit (-n) k = Zopp (Zdigit n k).
Theorem Zdigit_ge_Zpower_pos : forall e n, (0 <= n < Zpower beta e)%Z -> forall k, (e <= k)%Z -> Zdigit n k = Z0.
Theorem Zdigit_ge_Zpower : forall e n, (Zabs n < Zpower beta e)%Z -> forall k, (e <= k)%Z -> Zdigit n k = Z0.
Theorem Zdigit_not_0_pos : forall e n, (0 <= e)%Z -> (Zpower beta e <= n < Zpower beta (e + 1))%Z -> Zdigit n e <> Z0.
Theorem Zdigit_not_0 : forall e n, (0 <= e)%Z -> (Zpower beta e <= Zabs n < Zpower beta (e + 1))%Z -> Zdigit n e <> Z0.
Theorem Zdigit_mul_pow : forall n k k', (0 <= k')%Z -> Zdigit (n * Zpower beta k') k = Zdigit n (k - k').
Theorem Zdigit_div_pow : forall n k k', (0 <= k)%Z -> (0 <= k')%Z -> Zdigit (Z.quot n (Zpower beta k')) k = Zdigit n (k + k').
Theorem Zdigit_mod_pow : forall n k k', (k < k')%Z -> Zdigit (Z.rem n (Zpower beta k')) k = Zdigit n k.
Theorem Zdigit_mod_pow_out : forall n k k', (0 <= k' <= k)%Z -> Zdigit (Z.rem n (Zpower beta k')) k = Z0.