Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
This file is part of the Flocq formalization of floating-point arithmetic in Coq: http://flocq.gforge.inria.fr/
Copyright (C) 2011-2018 Sylvie Boldo
Copyright (C) 2011-2018 Guillaume Melquiond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details.
From Coq Require Import ZArith Zquot.

Require Import Zaux.
Require Import SpecFloatCompat.

Notation digits2_pos := digits2_pos (only parsing).
Notation Zdigits2 := Zdigits2 (only parsing).
Number of bits (radix 2) of a positive integer.
It serves as an upper bound on the number of digits to ensure termination.
Fixpoint digits2_Pnat (n : positive) : nat :=
  match n with
  | xH => O
  | xO p => S (digits2_Pnat p)
  | xI p => S (digits2_Pnat p)
  end.


forall n : positive, let d := digits2_Pnat n in (Zpower_nat 2 d <= Z.pos n < Zpower_nat 2 (S d))%Z

forall n : positive, let d := digits2_Pnat n in (Zpower_nat 2 d <= Z.pos n < Zpower_nat 2 (S d))%Z
n:positive
d:=digits2_Pnat n:nat

(Zpower_nat 2 d <= Z.pos n < Zpower_nat 2 (S d))%Z
n:positive
d:=digits2_Pnat n:nat

(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z
n:positive

(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z

(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z

(Zpower_nat 2 (S (digits2_Pnat n)) <= Z.pos n~1 < Zpower_nat 2 (S (S (digits2_Pnat n))))%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z
(Zpower_nat 2 (S (digits2_Pnat n)) <= Z.pos n~0 < Zpower_nat 2 (S (S (digits2_Pnat n))))%Z
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
(Zpower_nat 2 0 <= 1 < Zpower_nat 2 1)%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z

(2 * Zpower_nat 2 (digits2_Pnat n) <= 2 * Z.pos n + 1 < 2 * Zpower_nat 2 (S (digits2_Pnat n)))%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z
(Zpower_nat 2 (S (digits2_Pnat n)) <= Z.pos n~0 < Zpower_nat 2 (S (S (digits2_Pnat n))))%Z
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
(Zpower_nat 2 0 <= 1 < Zpower_nat 2 1)%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z

(Zpower_nat 2 (S (digits2_Pnat n)) <= Z.pos n~0 < Zpower_nat 2 (S (S (digits2_Pnat n))))%Z
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
(Zpower_nat 2 0 <= 1 < Zpower_nat 2 1)%Z
n:positive
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
IHn:(Zpower_nat 2 (digits2_Pnat n) <= Z.pos n < Zpower_nat 2 (S (digits2_Pnat n)))%Z

(2 * Zpower_nat 2 (digits2_Pnat n) <= 2 * Z.pos n < 2 * Zpower_nat 2 (S (digits2_Pnat n)))%Z
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z
(Zpower_nat 2 0 <= 1 < Zpower_nat 2 1)%Z
Hp:forall m : nat, Zpower_nat 2 (S m) = (2 * Zpower_nat 2 m)%Z

(Zpower_nat 2 0 <= 1 < Zpower_nat 2 1)%Z
now split. Qed. Section Fcore_digits. Variable beta : radix. Definition Zdigit n k := Z.rem (Z.quot n (Zpower beta k)) beta.
beta:radix

forall n k : Z, (k < 0)%Z -> Zdigit n k = 0%Z
beta:radix

forall n k : Z, (k < 0)%Z -> Zdigit n k = 0%Z
beta:radix
n:Z
k:positive
Hk:(Z.neg k < 0)%Z

Zdigit n (Z.neg k) = 0%Z
now case n. Qed.
beta:radix

forall k : Z, Zdigit 0 k = 0%Z
beta:radix

forall k : Z, Zdigit 0 k = 0%Z
beta:radix
k:Z

Zdigit 0 k = 0%Z
beta:radix
k:Z

Z.rem (0 ÷ beta ^ k) beta = 0%Z
beta:radix
k:Z

Z.rem 0 beta = 0%Z
apply Zrem_0_l. Qed.
beta:radix

forall n k : Z, Zdigit (- n) k = (- Zdigit n k)%Z
beta:radix

forall n k : Z, Zdigit (- n) k = (- Zdigit n k)%Z
beta:radix
n, k:Z

Zdigit (- n) k = (- Zdigit n k)%Z
beta:radix
n, k:Z

Z.rem (- n ÷ beta ^ k) beta = (- Z.rem (n ÷ beta ^ k) beta)%Z
beta:radix
n, k:Z

Z.rem (- (n ÷ beta ^ k)) beta = (- Z.rem (n ÷ beta ^ k) beta)%Z
apply Zrem_opp_l. Qed.
beta:radix

forall e n : Z, (0 <= n < beta ^ e)%Z -> forall k : Z, (e <= k)%Z -> Zdigit n k = 0%Z
beta:radix

forall e n : Z, (0 <= n < beta ^ e)%Z -> forall k : Z, (e <= k)%Z -> Zdigit n k = 0%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

Zdigit n k = 0%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

Z.rem (n ÷ beta ^ k) beta = 0%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

Z.rem 0 beta = 0%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= n < beta ^ k)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= n < beta ^ k)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= n)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(n < beta ^ k)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(n < beta ^ k)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(beta ^ e <= beta ^ k)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(beta ^ e <= beta ^ (e + (k - e)))%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(beta ^ e <= beta ^ e * beta ^ (k - e))%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(beta ^ e * 1 <= beta ^ e * beta ^ (k - e))%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(1 <= beta ^ (k - e))%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= beta ^ e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 < beta ^ (k - e))%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= beta ^ e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= beta ^ e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= beta ^ e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 < beta ^ e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 < beta ^ e)%Z -> (0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e:Z

(0 < beta ^ e)%Z -> (0 <= e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z
(0 <= k - e)%Z
beta:radix
e, n:Z
Hn:(0 <= n < beta ^ e)%Z
k:Z
Hk:(e <= k)%Z

(0 <= k - e)%Z
now apply Zle_minus_le_0. Qed.
beta:radix

forall e n : Z, (Z.abs n < beta ^ e)%Z -> forall k : Z, (e <= k)%Z -> Zdigit n k = 0%Z
beta:radix

forall e n : Z, (Z.abs n < beta ^ e)%Z -> forall k : Z, (e <= k)%Z -> Zdigit n k = 0%Z
beta:radix
e:Z
Hn:(Z.abs 0 < beta ^ e)%Z
k:Z

(e <= k)%Z -> Zdigit 0 k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.pos n) < beta ^ e)%Z
k:Z
(e <= k)%Z -> Zdigit (Z.pos n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
(e <= k)%Z -> Zdigit (Z.neg n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.pos n) < beta ^ e)%Z
k:Z

(e <= k)%Z -> Zdigit (Z.pos n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
(e <= k)%Z -> Zdigit (Z.neg n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.pos n) < beta ^ e)%Z
k:Z

(0 <= Z.pos n < beta ^ e)%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
(e <= k)%Z -> Zdigit (Z.neg n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z

(e <= k)%Z -> Zdigit (Z.neg n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z

Zdigit (Z.neg n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z

Zdigit (- Z.pos n) k = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z

(- Zdigit (Z.pos n) k)%Z = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z

(- 0)%Z = 0%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z
(0 <= Z.pos n < beta ^ e)%Z
beta:radix
e:Z
n:positive
Hn:(Z.abs (Z.neg n) < beta ^ e)%Z
k:Z
He:(e <= k)%Z

(0 <= Z.pos n < beta ^ e)%Z
now split. Qed.
beta:radix

forall e n : Z, (0 <= e)%Z -> (beta ^ e <= n < beta ^ (e + 1))%Z -> Zdigit n e <> 0%Z
beta:radix

forall e n : Z, (0 <= e)%Z -> (beta ^ e <= n < beta ^ (e + 1))%Z -> Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

Z.rem (n ÷ beta ^ e) beta <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(Z.rem n (beta ^ e * beta) ÷ beta ^ e)%Z <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(n ÷ beta ^ e)%Z <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

False
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(n < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(beta ^ e * (n ÷ beta ^ e) + Z.rem n (beta ^ e) < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(Z.rem n (beta ^ e) < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(0 <= n)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z
(0 < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(0 <= beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z
(0 < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
H:(n ÷ beta ^ e)%Z = 0%Z

(0 < beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(0 <= n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(0 <= n)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(0 <= beta ^ e)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(n < beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(n < beta ^ (e + 1))%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z
(beta ^ (e + 1))%Z = (beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(beta ^ (e + 1))%Z = (beta ^ e * beta)%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn1:(beta ^ e <= n)%Z
Hn2:(n < beta ^ (e + 1))%Z

(beta ^ (e + 1))%Z = (beta ^ e * (beta * 1))%Z
now apply (Zpower_plus beta e 1). Qed.
beta:radix

forall e n : Z, (0 <= e)%Z -> (beta ^ e <= Z.abs n < beta ^ (e + 1))%Z -> Zdigit n e <> 0%Z
beta:radix

forall e n : Z, (0 <= e)%Z -> (beta ^ e <= Z.abs n < beta ^ (e + 1))%Z -> Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z

Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z
Hn':(0 <= n)%Z

Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z
Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= n < beta ^ (e + 1))%Z
Hn':(0 <= n)%Z

Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z
Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z

Zdigit n e <> 0%Z
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= Z.abs n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z
H:Zdigit n e = 0%Z

False
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= - n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z
H:Zdigit n e = 0%Z

False
beta:radix
e, n:Z
He:(0 <= e)%Z
Hn:(beta ^ e <= - n < beta ^ (e + 1))%Z
Hn':(n < 0)%Z
H:Zdigit n e = 0%Z

Zdigit (- n) e = 0%Z
now rewrite Zdigit_opp, H. Qed.
beta:radix

forall n k k' : Z, (0 <= k')%Z -> Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix

forall n k k' : Z, (0 <= k')%Z -> Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k' <= k)%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
Hk':(0 <= k')%Z

forall k : Z, (k' <= k)%Z -> Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
Hk':(0 <= k')%Z

forall x : Z, (forall y : Z, (0 <= y < x)%Z -> forall k : Z, (y <= k)%Z -> Zdigit (n * beta ^ y) k = Zdigit n (k - y)) -> (0 <= x)%Z -> forall k : Z, (x <= k)%Z -> Zdigit (n * beta ^ x) k = Zdigit n (k - x)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n:Z

forall x : Z, (forall y : Z, (0 <= y < x)%Z -> forall k : Z, (y <= k)%Z -> Zdigit (n * beta ^ y) k = Zdigit n (k - y)) -> (0 <= x)%Z -> forall k : Z, (x <= k)%Z -> Zdigit (n * beta ^ x) k = Zdigit n (k - x)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

Z.rem (n * beta ^ k' ÷ beta ^ k) beta = Z.rem (n ÷ beta ^ (k - k')) beta
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(n * beta ^ k' ÷ beta ^ k)%Z = (n ÷ beta ^ (k - k'))%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(n * beta ^ k' ÷ beta ^ (k - k' + k'))%Z = (n ÷ beta ^ (k - k'))%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(n * beta ^ k' ÷ (beta ^ (k - k') * beta ^ k'))%Z = (n ÷ beta ^ (k - k'))%Z
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z
(0 <= k - k')%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(beta ^ k')%Z <> 0%Z
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z
(0 <= k - k')%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(0 < beta ^ k')%Z
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z
(0 <= k - k')%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k':Z
IHk':forall y : Z, (0 <= y < k')%Z -> forall k0 : Z, (y <= k0)%Z -> Zdigit (n * beta ^ y) k0 = Zdigit n (k0 - y)
Hk':(0 <= k')%Z
k:Z
H:(k' <= k)%Z

(0 <= k - k')%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Zdigit (n * beta ^ k') k = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ k' ÷ beta ^ k) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k + k) ÷ beta ^ k) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * (beta ^ (k' - k) * beta ^ k) ÷ beta ^ k) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k)) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k - 1 + 1)) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * (beta ^ (k' - k - 1) * beta ^ 1)) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k - 1) * beta ^ 1) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k - 1) * (beta * 1)) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

Z.rem (n * beta ^ (k' - k - 1) * beta) beta = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

(0 < beta ^ k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z
(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

(0 <= k' - k)%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(0 <= k)%Z

(k <= k')%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z
Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z

Zdigit (n * beta ^ k') k = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z

0%Z = Zdigit n (k - k')
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z

Zdigit n (k - k') = 0%Z
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
H:(k < k')%Z
H0:(k < 0)%Z

(k - k' < 0)%Z
omega. Qed.
beta:radix

forall n k k' : Z, (0 <= k)%Z -> (0 <= k')%Z -> Zdigit (n ÷ beta ^ k') k = Zdigit n (k + k')
beta:radix

forall n k k' : Z, (0 <= k)%Z -> (0 <= k')%Z -> Zdigit (n ÷ beta ^ k') k = Zdigit n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

Zdigit (n ÷ beta ^ k') k = Zdigit n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

Z.rem (n ÷ beta ^ k' ÷ beta ^ k) beta = Z.rem (n ÷ beta ^ (k + k')) beta
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

Z.rem (n ÷ (beta ^ k' * beta ^ k)) beta = Z.rem (n ÷ beta ^ (k + k')) beta
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

Z.rem (n ÷ (beta ^ k' * beta ^ k)) beta = Z.rem (n ÷ beta ^ (k' + k)) beta
now rewrite Zpower_plus. Qed.
beta:radix

forall n k k' : Z, (k < k')%Z -> Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix

forall n k k' : Z, (k < k')%Z -> Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z

Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ k') ÷ beta ^ k) beta = Z.rem (n ÷ beta ^ k) beta
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

(Z.rem (Z.rem n (beta ^ k')) (beta ^ k * beta) ÷ beta ^ k)%Z = (Z.rem n (beta ^ k * beta) ÷ beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ k')) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k + 1 + (k' - (k + 1))))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k + 1) * beta ^ (k' - (k + 1)))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k' - (k + 1)) * beta ^ (k + 1))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k' - (k + 1)) * (beta ^ k * beta ^ 1))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k' - (k + 1)) * (beta ^ k * (beta * 1)))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(0 <= k)%Z

Z.rem (Z.rem n (beta ^ (k' - (k + 1)) * (beta ^ k * beta))) (beta ^ k * beta) = Z.rem n (beta ^ k * beta)
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z
Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
beta:radix
n, k, k':Z
Hk:(k < k')%Z
H:(k < 0)%Z

Zdigit (Z.rem n (beta ^ k')) k = Zdigit n k
now rewrite 2!Zdigit_lt. Qed.
beta:radix

forall n k k' : Z, (0 <= k' <= k)%Z -> Zdigit (Z.rem n (beta ^ k')) k = 0%Z
beta:radix

forall n k k' : Z, (0 <= k' <= k)%Z -> Zdigit (Z.rem n (beta ^ k')) k = 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

Zdigit (Z.rem n (beta ^ k')) k = 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

Z.rem (Z.rem n (beta ^ k') ÷ beta ^ k) beta = 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

Z.rem 0 beta = 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z
(Z.abs (Z.rem n (beta ^ k')) < beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(Z.abs (Z.rem n (beta ^ k')) < beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(Z.abs (Z.rem n (beta ^ k')) < beta ^ k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z
(beta ^ k' <= beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(Z.abs (Z.rem n (beta ^ k')) < Z.abs (beta ^ k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z
(beta ^ k' <= beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(beta ^ k')%Z <> 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z
(beta ^ k' <= beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(0 < beta ^ k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z
(beta ^ k' <= beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k' <= k)%Z

(beta ^ k' <= beta ^ k)%Z
now apply Zpower_le. Qed. Fixpoint Zsum_digit f k := match k with | O => Z0 | S k => (Zsum_digit f k + f (Z_of_nat k) * Zpower beta (Z_of_nat k))%Z end.
beta:radix

forall (n : Z) (k : nat), Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
beta:radix

forall (n : Z) (k : nat), Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
beta:radix
n:Z

forall k : nat, Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
beta:radix
n:Z

Zsum_digit (Zdigit n) 0 = Z.rem n (beta ^ Z.of_nat 0)
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
Zsum_digit (Zdigit n) (S k) = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z

Z.rem n (beta ^ Z.of_nat 0) = Zsum_digit (Zdigit n) 0
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
Zsum_digit (Zdigit n) (S k) = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

Zsum_digit (Zdigit n) (S k) = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Zsum_digit (Zdigit n) k + Zdigit n (Z.of_nat k) * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem n (beta ^ Z.of_nat k) + Zdigit n (Z.of_nat k) * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem n (beta ^ Z.of_nat k) + Z.rem (n ÷ beta ^ Z.of_nat k) beta * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem n (beta ^ Z.of_nat k) + Z.rem n (beta ^ Z.of_nat k * beta) ÷ beta ^ Z.of_nat k * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem (Z.rem n (beta * beta ^ Z.of_nat k)) (beta ^ Z.of_nat k) + Z.rem n (beta ^ Z.of_nat k * beta) ÷ beta ^ Z.of_nat k * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem (Z.rem n (beta ^ Z.of_nat k * beta)) (beta ^ Z.of_nat k) + Z.rem n (beta ^ Z.of_nat k * beta) ÷ beta ^ Z.of_nat k * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(Z.rem (Z.rem n (beta ^ Z.of_nat (S k))) (beta ^ Z.of_nat k) + Z.rem n (beta ^ Z.of_nat (S k)) ÷ beta ^ Z.of_nat k * beta ^ Z.of_nat k)%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
(beta ^ Z.of_nat (S k))%Z = (beta ^ Z.of_nat k * beta)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(beta ^ Z.of_nat k * (Z.rem n (beta ^ Z.of_nat (S k)) ÷ beta ^ Z.of_nat k) + Z.rem (Z.rem n (beta ^ Z.of_nat (S k))) (beta ^ Z.of_nat k))%Z = Z.rem n (beta ^ Z.of_nat (S k))
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
(beta ^ Z.of_nat (S k))%Z = (beta ^ Z.of_nat k * beta)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

Z.rem n (beta ^ Z.of_nat (S k)) = (beta ^ Z.of_nat k * (Z.rem n (beta ^ Z.of_nat (S k)) ÷ beta ^ Z.of_nat k) + Z.rem (Z.rem n (beta ^ Z.of_nat (S k))) (beta ^ Z.of_nat k))%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
(beta ^ Z.of_nat (S k))%Z = (beta ^ Z.of_nat k * beta)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(beta ^ Z.of_nat (S k))%Z = (beta ^ Z.of_nat k * beta)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(beta ^ Z.succ (Z.of_nat k))%Z = (beta ^ Z.of_nat k * beta)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(beta ^ Z.succ (Z.of_nat k))%Z = (beta ^ Z.of_nat k * (beta * 1))%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(0 <= Z.of_nat k)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)
(0 <= 1)%Z
beta:radix
n:Z
k:nat
IHk:Zsum_digit (Zdigit n) k = Z.rem n (beta ^ Z.of_nat k)

(0 <= 1)%Z
easy. Qed.
beta:radix

forall n1 n2 : Z, (forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k) -> n1 = n2
beta:radix

forall n1 n2 : Z, (forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k) -> n1 = n2
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

n1 = n2
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Z.rem n1 (beta ^ Z.max (Z.abs n1) (Z.abs n2)) = n2
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Z.rem n1 (beta ^ Z.max (Z.abs n1) (Z.abs n2)) = Z.rem n2 (beta ^ Z.max (Z.abs n1) (Z.abs n2))
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Z.rem n1 (beta ^ Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2)))) = Z.rem n2 (beta ^ Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))))
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Zsum_digit (Zdigit n1) (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Zsum_digit (Zdigit n2) (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2)))
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Zsum_digit (Zdigit n1) 0 = Zsum_digit (Zdigit n2) 0
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n
Zsum_digit (Zdigit n1) (S n) = Zsum_digit (Zdigit n2) (S n)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n

Zsum_digit (Zdigit n1) (S n) = Zsum_digit (Zdigit n2) (S n)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n

(Zsum_digit (Zdigit n1) n + Zdigit n1 (Z.of_nat n) * beta ^ Z.of_nat n)%Z = (Zsum_digit (Zdigit n2) n + Zdigit n2 (Z.of_nat n) * beta ^ Z.of_nat n)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n

(Zsum_digit (Zdigit n2) n + Zdigit n2 (Z.of_nat n) * beta ^ Z.of_nat n)%Z = (Zsum_digit (Zdigit n2) n + Zdigit n2 (Z.of_nat n) * beta ^ Z.of_nat n)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n
(0 <= Z.of_nat n)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
n:nat
IHn:Zsum_digit (Zdigit n1) n = Zsum_digit (Zdigit n2) n

(0 <= Z.of_nat n)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Z.of_nat (Z.abs_nat (Z.max (Z.abs n1) (Z.abs n2))) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

Z.abs (Z.max (Z.abs n1) (Z.abs n2)) = Z.max (Z.abs n1) (Z.abs n2)
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(0 <= Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(0 <= Z.abs n1)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 <= Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n1 <= Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n2 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n2 < beta ^ Z.abs n2)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(beta ^ Z.abs n2 <= beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(beta ^ Z.abs n2 <= beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n2 <= Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n1 < beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n1 < beta ^ Z.abs n1)%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k
(beta ^ Z.abs n1 <= beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(beta ^ Z.abs n1 <= beta ^ Z.max (Z.abs n1) (Z.abs n2))%Z
beta:radix
n1, n2:Z
H:forall k : Z, (0 <= k)%Z -> Zdigit n1 k = Zdigit n2 k

(Z.abs n1 <= Z.max (Z.abs n1) (Z.abs n2))%Z
apply Z.le_max_l. Qed.
beta:radix

forall u v n : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix

forall u v n : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

Z.rem (Z.rem u (beta ^ n) + Z.rem v (beta ^ n)) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.abs (Z.rem u (beta ^ n) + Z.rem v (beta ^ n)) < beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(n <= n)%Z -> (Z.abs (Z.rem u (beta ^ n) + Z.rem v (beta ^ n)) < beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.abs n <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.abs n) + Z.rem v (beta ^ Z.abs n)) < beta ^ Z.abs n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.of_nat (Z.abs_nat n) <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat (Z.abs_nat n)) + Z.rem v (beta ^ Z.of_nat (Z.abs_nat n))) < beta ^ Z.of_nat (Z.abs_nat n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.of_nat 0 <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat 0) + Z.rem v (beta ^ Z.of_nat 0)) < beta ^ Z.of_nat 0)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
(Z.of_nat (S p) <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat (S p)) + Z.rem v (beta ^ Z.of_nat (S p))) < beta ^ Z.of_nat (S p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z

(Z.of_nat (S p) <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat (S p)) + Z.rem v (beta ^ Z.of_nat (S p))) < beta ^ Z.of_nat (S p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z

(Z.of_nat (S p) <= n)%Z -> (Z.abs (Zsum_digit (Zdigit u) (S p) + Zsum_digit (Zdigit v) (S p)) < beta ^ Z.of_nat (S p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z

(Z.of_nat (S p) <= n)%Z -> (Z.abs (Zsum_digit (Zdigit u) p + Zdigit u (Z.of_nat p) * beta ^ Z.of_nat p + (Zsum_digit (Zdigit v) p + Zdigit v (Z.of_nat p) * beta ^ Z.of_nat p)) < beta ^ Z.of_nat (S p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z

(Z.succ (Z.of_nat p) <= n)%Z -> (Z.abs (Zsum_digit (Zdigit u) p + Zdigit u (Z.of_nat p) * beta ^ Z.of_nat p + (Zsum_digit (Zdigit v) p + Zdigit v (Z.of_nat p) * beta ^ Z.of_nat p)) < beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zsum_digit (Zdigit u) p + Zdigit u (Z.of_nat p) * beta ^ Z.of_nat p + (Zsum_digit (Zdigit v) p + Zdigit v (Z.of_nat p) * beta ^ Z.of_nat p)) < beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zsum_digit (Zdigit u) p + Zsum_digit (Zdigit v) p + (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) < beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zsum_digit (Zdigit u) p + Zsum_digit (Zdigit v) p) + Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) < beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zsum_digit (Zdigit u) p + Zsum_digit (Zdigit v) p) + Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) < beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zsum_digit (Zdigit u) p + Zsum_digit (Zdigit v) p) < beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.of_nat p <= n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs ((Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p) <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * Z.abs (beta ^ Z.of_nat p) <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) * beta ^ Z.of_nat p <= (beta - 1) * beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) <= beta - 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= beta ^ Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) <= beta - 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z

(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z

(0 < beta)%Z
beta:radix
n, k:Z
H:(0 < beta)%Z
(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z

(0 < 2)%Z
beta:radix
n, k:Z
(2 <= beta)%Z
beta:radix
n, k:Z
H:(0 < beta)%Z
(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z

(2 <= beta)%Z
beta:radix
n, k:Z
H:(0 < beta)%Z
(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z

(2 <=? beta)%Z = true
beta:radix
n, k:Z
H:(0 < beta)%Z
(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

(Z.abs (Zdigit n k) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

(Z.abs (Zdigit n k) < Z.abs beta)%Z
beta:radix
n, k:Z
H:(0 < beta)%Z
Z.abs beta = Z.succ (beta - 1)
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

beta <> 0%Z
beta:radix
n, k:Z
H:(0 < beta)%Z
Z.abs beta = Z.succ (beta - 1)
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

Z.abs beta = Z.succ (beta - 1)
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

beta = Z.succ (beta - 1)
beta:radix
n, k:Z
H:(0 < beta)%Z
(0 <= beta)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
n, k:Z
H:(0 < beta)%Z

(0 <= beta)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z

(0 <= Z.of_nat p < n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z

(0 <= Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
(Z.of_nat p < n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z

(Z.of_nat p < n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z

(n > Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z

(Z.abs (Zdigit u (Z.of_nat p) + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
K:Zdigit u (Z.of_nat p) = 0%Z

(Z.abs (0 + Zdigit v (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
K:Zdigit v (Z.of_nat p) = 0%Z
(Z.abs (Zdigit u (Z.of_nat p) + 0) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
K:Zdigit v (Z.of_nat p) = 0%Z

(Z.abs (Zdigit u (Z.of_nat p) + 0) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
H:forall u0 v0 : Z, (Z.abs (Zdigit u0 v0) < Z.succ (beta - 1))%Z
H0:(0 <= Z.of_nat p < n)%Z
K:Zdigit v (Z.of_nat p) = 0%Z

(Z.abs (Zdigit u (Z.of_nat p)) < Z.succ (beta - 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ Z.succ (Z.of_nat p))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(beta ^ Z.of_nat p + (beta - 1) * beta ^ Z.of_nat p)%Z = (beta ^ (Z.of_nat p + 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(beta ^ Z.of_nat p * beta)%Z = (beta ^ (Z.of_nat p + 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(beta ^ Z.of_nat p * beta)%Z = (beta ^ Z.of_nat p * beta ^ 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(beta ^ Z.of_nat p * beta)%Z = (beta ^ Z.of_nat p * (beta * 1))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(0 <= Z.of_nat p)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z
(0 <= 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
p:nat
IHp:(Z.of_nat p <= n)%Z -> (Z.abs (Z.rem u (beta ^ Z.of_nat p) + Z.rem v (beta ^ Z.of_nat p)) < beta ^ Z.of_nat p)%Z
Hn':(Z.succ (Z.of_nat p) <= n)%Z

(0 <= 1)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z

Z.rem (u + v) (beta ^ n) = (Z.rem u (beta ^ n) + Z.rem v (beta ^ n))%Z
beta:radix
u, v:Z
n:positive
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < Z.neg n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(Z.neg n < 0)%Z

Z.rem (u + v) (beta ^ Z.neg n) = (Z.rem u (beta ^ Z.neg n) + Z.rem v (beta ^ Z.neg n))%Z
now rewrite 3!Zrem_0_r. Qed.
beta:radix

forall u v n : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> ((u + v) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n)%Z
beta:radix

forall u v n : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> ((u + v) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

((u + v) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

((u + v) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n + 0)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

(u ÷ beta ^ n + v ÷ beta ^ n + (Z.rem u (beta ^ n) + Z.rem v (beta ^ n)) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n + 0)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

(u ÷ beta ^ n + v ÷ beta ^ n + Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = (u ÷ beta ^ n + v ÷ beta ^ n + 0)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z

(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.abs (Z.rem (u + v) (beta ^ n)) < beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(Z.abs (Z.rem (u + v) (beta ^ n)) < Z.abs (beta ^ n))%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
(0 <= beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(beta ^ n)%Z <> 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
(0 <= beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(0 < beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z
(0 <= beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(0 <= n)%Z

(0 <= beta ^ n)%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z
(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Huv:(0 <= u * v)%Z
Hd:forall k : Z, (0 <= k < n)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z
Hn:(n < 0)%Z

(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v, n:Z
Hn:(n < 0)%Z

(Z.rem (u + v) (beta ^ n) ÷ beta ^ n)%Z = 0%Z
beta:radix
u, v:Z
n:positive
Hn:(Z.neg n < 0)%Z

(Z.rem (u + v) (beta ^ Z.neg n) ÷ beta ^ Z.neg n)%Z = 0%Z
apply Zquot_0_r. Qed.
beta:radix

forall u v : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> forall k : Z, Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix

forall u v : Z, (0 <= u * v)%Z -> (forall k : Z, (0 <= k)%Z -> Zdigit u k = 0%Z \/ Zdigit v k = 0%Z) -> forall k : Z, Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z

Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

Z.rem ((u + v) ÷ beta ^ k) beta = (Z.rem (u ÷ beta ^ k) beta + Z.rem (v ÷ beta ^ k) beta)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

Z.rem (u ÷ beta ^ k + v ÷ beta ^ k) beta = (Z.rem (u ÷ beta ^ k) beta + Z.rem (v ÷ beta ^ k) beta)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

Z.rem (u ÷ beta ^ k + v ÷ beta ^ k) (beta * 1) = (Z.rem (u ÷ beta ^ k) (beta * 1) + Z.rem (v ÷ beta ^ k) (beta * 1))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

Z.rem (u ÷ beta ^ k + v ÷ beta ^ k) (beta ^ 1) = (Z.rem (u ÷ beta ^ k) (beta ^ 1) + Z.rem (v ÷ beta ^ k) (beta ^ 1))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= u ÷ beta ^ k * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

v = 0%Z -> (v ÷ beta ^ k)%Z = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= u ÷ beta ^ k * v)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
Zv:v = 0%Z

(0 ÷ beta ^ k)%Z = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= u ÷ beta ^ k * v)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= u ÷ beta ^ k * v)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= v * (u ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

u = 0%Z -> (u ÷ beta ^ k)%Z = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * u)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= u * (u ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
Zu:u = 0%Z

(0 ÷ beta ^ k)%Z = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * u)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= u * (u ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= v * u)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= u * (u ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= u * (u ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= beta ^ k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= v * (v ÷ beta ^ k))%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

(0 <= beta ^ k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

forall k0 : Z, (0 <= k0 < 1)%Z -> Zdigit (u ÷ beta ^ k) k0 = 0%Z \/ Zdigit (v ÷ beta ^ k) k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
k':Z
Hk1:(0 <= k')%Z
Hk2:(k' < 1)%Z

Zdigit (u ÷ beta ^ k) k' = 0%Z \/ Zdigit (v ÷ beta ^ k) k' = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
k':Z
Hk1:(0 <= k')%Z
Hk2:(k' < 1)%Z

Zdigit u (k' + k) = 0%Z \/ Zdigit v (k' + k) = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
k':Z
Hk1:(0 <= k')%Z
Hk2:(k' < 1)%Z

(0 <= k' + k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z

forall k0 : Z, (0 <= k0 < k)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(0 <= k)%Z
k':Z
Hk1:(0 <= k')%Z
Hk2:(k' < k)%Z

Zdigit u k' = 0%Z \/ Zdigit v k' = 0%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z
Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
beta:radix
u, v:Z
Huv:(0 <= u * v)%Z
Hd:forall k0 : Z, (0 <= k0)%Z -> Zdigit u k0 = 0%Z \/ Zdigit v k0 = 0%Z
k:Z
Hk:(k < 0)%Z

Zdigit (u + v) k = (Zdigit u k + Zdigit v k)%Z
now rewrite 3!Zdigit_lt. Qed.
Left and right shifts
Definition Zscale n k :=
  if Zle_bool 0 k then (n * Zpower beta k)%Z else Z.quot n (Zpower beta (-k)).

beta:radix

forall n k k' : Z, (0 <= k')%Z -> Zdigit (Zscale n k) k' = Zdigit n (k' - k)
beta:radix

forall n k k' : Z, (0 <= k')%Z -> Zdigit (Zscale n k) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z

Zdigit (Zscale n k) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z

Zdigit (if (0 <=? k)%Z then (n * beta ^ k)%Z else (n ÷ beta ^ (- k))%Z) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
Hk:(0 <= k)%Z

Zdigit (n * beta ^ k) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
Hk:(k < 0)%Z
Zdigit (n ÷ beta ^ (- k)) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
Hk:(k < 0)%Z

Zdigit (n ÷ beta ^ (- k)) k' = Zdigit n (k' - k)
beta:radix
n, k, k':Z
Hk':(0 <= k')%Z
Hk:(k < 0)%Z

(0 <= - k)%Z
omega. Qed.
beta:radix

forall k : Z, Zscale 0 k = 0%Z
beta:radix

forall k : Z, Zscale 0 k = 0%Z
beta:radix
k:Z

Zscale 0 k = 0%Z
beta:radix
k:Z

(if (0 <=? k)%Z then (0 * beta ^ k)%Z else (0 ÷ beta ^ (- k))%Z) = 0%Z
beta:radix
k:Z

(0 * beta ^ k)%Z = 0%Z
beta:radix
k:Z
(0 ÷ beta ^ (- k))%Z = 0%Z
beta:radix
k:Z

(0 ÷ beta ^ (- k))%Z = 0%Z
apply Zquot_0_l. Qed.
beta:radix

forall n k : Z, (0 <= n * Zscale n k)%Z
beta:radix

forall n k : Z, (0 <= n * Zscale n k)%Z
beta:radix
n, k:Z

(0 <= n * Zscale n k)%Z
beta:radix
n, k:Z

(0 <= n * (if 0 <=? k then n * beta ^ k else n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(0 <= k)%Z

(0 <= n * (n * beta ^ k))%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z
(0 <= n * (n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(0 <= k)%Z

(0 <= n * n * beta ^ k)%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z
(0 <= n * (n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(0 <= k)%Z

(0 <= n * n)%Z
beta:radix
n, k:Z
Hk:(0 <= k)%Z
(0 <= beta ^ k)%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z
(0 <= n * (n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(0 <= k)%Z

(0 <= beta ^ k)%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z
(0 <= n * (n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z

(0 <= n * (n ÷ beta ^ (- k)))%Z
beta:radix
n, k:Z
Hk:(k < 0)%Z

(0 <= beta ^ (- k))%Z
apply Zpower_ge_0. Qed.
beta:radix

forall n k k' : Z, (0 <= k)%Z -> Zscale (n * beta ^ k) k' = Zscale n (k + k')
beta:radix

forall n k k' : Z, (0 <= k)%Z -> Zscale (n * beta ^ k) k' = Zscale n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z

Zscale (n * beta ^ k) k' = Zscale n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z

(if (0 <=? k')%Z then (n * beta ^ k * beta ^ k')%Z else (n * beta ^ k ÷ beta ^ (- k'))%Z) = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

(n * beta ^ k * beta ^ k')%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

(n * beta ^ k * beta ^ k')%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z
(0 <= k + k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

(n * (beta ^ k * beta ^ k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z
(0 <= k + k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

(beta ^ k * beta ^ k')%Z = (beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z
(0 <= k + k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(0 <= k')%Z

(0 <= k + k')%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z

(n * beta ^ k ÷ beta ^ (- k'))%Z = (if (0 <=? k + k')%Z then (n * beta ^ (k + k'))%Z else (n ÷ beta ^ (- (k + k')))%Z)
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z

(n * beta ^ k ÷ beta ^ (- k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z

(n * beta ^ (k + k' + - k') ÷ beta ^ (- k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z

(n * beta ^ (k + k' + - k') ÷ beta ^ (- k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z

(n * (beta ^ (k + k') * beta ^ (- k')) ÷ beta ^ (- k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z

(n * beta ^ (k + k'))%Z = (n * beta ^ (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z
(beta ^ (- k'))%Z <> 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z

(beta ^ (- k'))%Z <> 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(0 <= k + k')%Z
H:(0 <= - k')%Z

(0 < beta ^ (- k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(n * beta ^ k ÷ beta ^ (- k'))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(n * beta ^ k ÷ beta ^ (- (k + k') + k))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(n * beta ^ k ÷ (beta ^ (- (k + k')) * beta ^ k))%Z = (n ÷ beta ^ (- (k + k')))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(0 <= - (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(beta ^ k)%Z <> 0%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(0 <= - (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(0 < beta ^ k)%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z
(0 <= - (k + k'))%Z
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z
Hk':(k' < 0)%Z
Hk'':(k + k' < 0)%Z

(0 <= - (k + k'))%Z
omega. Qed.
beta:radix

forall n k k' : Z, (0 <= k)%Z -> Zscale (Zscale n k) k' = Zscale n (k + k')
beta:radix

forall n k k' : Z, (0 <= k)%Z -> Zscale (Zscale n k) k' = Zscale n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z

Zscale (Zscale n k) k' = Zscale n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z

Zscale (if (0 <=? k)%Z then (n * beta ^ k)%Z else (n ÷ beta ^ (- k))%Z) k' = Zscale n (k + k')
beta:radix
n, k, k':Z
Hk:(0 <= k)%Z

Zscale (n * beta ^ k) k' = Zscale n (k + k')
now apply Zscale_mul_pow. Qed.
Slice of an integer
Definition Zslice n k1 k2 :=
  if Zle_bool 0 k2 then Z.rem (Zscale n (-k1)) (Zpower beta k2) else Z0.

beta:radix

forall n k1 k2 k : Z, (0 <= k < k2)%Z -> Zdigit (Zslice n k1 k2) k = Zdigit n (k1 + k)
beta:radix

forall n k1 k2 k : Z, (0 <= k < k2)%Z -> Zdigit (Zslice n k1 k2) k = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit (Zslice n k1 k2) k = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit (if (0 <=? k2)%Z then Z.rem (Zscale n (- k1)) (beta ^ k2) else 0%Z) k = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit (Z.rem (Zscale n (- k1)) (beta ^ k2)) k = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z
(0 <= k2)%Z
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit (Zscale n (- k1)) k = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z
(0 <= k2)%Z
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit n (k - - k1) = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z
(0 <= k2)%Z
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

Zdigit n (k + - - k1) = Zdigit n (k1 + k)
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z
(0 <= k2)%Z
beta:radix
n, k1, k2, k:Z
Hk:(0 <= k < k2)%Z

(0 <= k2)%Z
omega. Qed.
beta:radix

forall n k1 k2 k : Z, (k2 <= k)%Z -> Zdigit (Zslice n k1 k2) k = 0%Z
beta:radix

forall n k1 k2 k : Z, (k2 <= k)%Z -> Zdigit (Zslice n k1 k2) k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z

Zdigit (Zslice n k1 k2) k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z

Zdigit (if (0 <=? k2)%Z then Z.rem (Zscale n (- k1)) (beta ^ k2) else 0%Z) k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z
Hk2:(0 <= k2)%Z

Zdigit (Z.rem (Zscale n (- k1)) (beta ^ k2)) k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z
Hk2:(k2 < 0)%Z
Zdigit 0 k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z
Hk2:(0 <= k2)%Z

(0 <= k2 <= k)%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z
Hk2:(k2 < 0)%Z
Zdigit 0 k = 0%Z
beta:radix
n, k1, k2, k:Z
Hk:(k2 <= k)%Z
Hk2:(k2 < 0)%Z

Zdigit 0 k = 0%Z
apply Zdigit_0. Qed.
beta:radix

forall k k' : Z, Zslice 0 k k' = 0%Z
beta:radix

forall k k' : Z, Zslice 0 k k' = 0%Z
beta:radix
k, k':Z

Zslice 0 k k' = 0%Z
beta:radix
k, k':Z

(if (0 <=? k')%Z then Z.rem (Zscale 0 (- k)) (beta ^ k') else 0%Z) = 0%Z
beta:radix
k, k':Z

Z.rem (Zscale 0 (- k)) (beta ^ k') = 0%Z
beta:radix
k, k':Z
0%Z = 0%Z
beta:radix
k, k':Z

Z.rem 0 (beta ^ k') = 0%Z
beta:radix
k, k':Z
0%Z = 0%Z
beta:radix
k, k':Z

0%Z = 0%Z
apply refl_equal. Qed.
beta:radix

forall n k k' : Z, (0 <= n * Zslice n k k')%Z
beta:radix

forall n k k' : Z, (0 <= n * Zslice n k k')%Z
beta:radix
n, k, k':Z

(0 <= n * Zslice n k k')%Z
beta:radix
n, k, k':Z

(0 <= n * (if 0 <=? k' then Z.rem (Zscale n (- k)) (beta ^ k') else 0))%Z
beta:radix
n, k, k':Z

(0 <= n * Z.rem (Zscale n (- k)) (beta ^ k'))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z

Zscale n (- k) = 0%Z -> Z.rem (Zscale n (- k)) (beta ^ k') = 0%Z
beta:radix
n, k, k':Z
(0 <= n * Zscale n (- k))%Z
beta:radix
n, k, k':Z
(0 <= Zscale n (- k) * Z.rem (Zscale n (- k)) (beta ^ k'))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z
H:Zscale n (- k) = 0%Z

Z.rem 0 (beta ^ k') = 0%Z
beta:radix
n, k, k':Z
(0 <= n * Zscale n (- k))%Z
beta:radix
n, k, k':Z
(0 <= Zscale n (- k) * Z.rem (Zscale n (- k)) (beta ^ k'))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z

(0 <= n * Zscale n (- k))%Z
beta:radix
n, k, k':Z
(0 <= Zscale n (- k) * Z.rem (Zscale n (- k)) (beta ^ k'))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z

(0 <= Zscale n (- k) * Z.rem (Zscale n (- k)) (beta ^ k'))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z

(0 <= Z.rem (Zscale n (- k)) (beta ^ k') * Zscale n (- k))%Z
beta:radix
n, k, k':Z
(0 <= n * 0)%Z
beta:radix
n, k, k':Z

(0 <= n * 0)%Z
now rewrite Zmult_0_r. Qed.
beta:radix

forall n k1 k2 k1' k2' : Z, (0 <= k1' <= k2)%Z -> Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix

forall n k1 k2 k1' k2' : Z, (0 <= k1' <= k2)%Z -> Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z

Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z

Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z

forall k : Z, (0 <= k)%Z -> Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = 0%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z
Hk'':(k2' <= k)%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = 0%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z
Hk'':(k < k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = 0%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z
Hk'':(k < k2')%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = 0%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z
Hk'':(k < k2')%Z

Zdigit (Zslice n k1 k2) (k1' + k) = 0%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(Z.min (k2 - k1') k2' <= k)%Z
Hk'':(k < k2')%Z

(k2 <= k1' + k)%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z

Zdigit (Zslice (Zslice n k1 k2) k1' k2') k = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z

Zdigit (Zslice n k1 k2) (k1' + k) = Zdigit (Zslice n (k1 + k1') (Z.min (k2 - k1') k2')) k
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z

Zdigit (Zslice n k1 k2) (k1' + k) = Zdigit n (k1 + k1' + k)
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z

Zdigit n (k1 + (k1' + k)) = Zdigit n (k1 + k1' + k)
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z
(0 <= k1' + k < k2)%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(0 <= k2')%Z
k:Z
Hk:(0 <= k)%Z
Hk':(k < Z.min (k2 - k1') k2')%Z

(0 <= k1' + k < k2)%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z

Zslice (Zslice n k1 k2) k1' k2' = Zslice n (k1 + k1') (Z.min (k2 - k1') k2')
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z

(if (0 <=? k2')%Z then Z.rem (Zscale (if (0 <=? k2)%Z then Z.rem (Zscale n (- k1)) (beta ^ k2) else 0%Z) (- k1')) (beta ^ k2') else 0%Z) = (if (0 <=? Z.min (k2 - k1') k2')%Z then Z.rem (Zscale n (- (k1 + k1'))) (beta ^ Z.min (k2 - k1') k2') else 0%Z)
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z

(if (0 <=? k2')%Z then Z.rem (Zscale (if (0 <=? k2)%Z then Z.rem (Zscale n (- k1)) (beta ^ k2) else 0%Z) (- k1')) (beta ^ k2') else 0%Z) = (if (0 <=? k2')%Z then Z.rem (Zscale n (- (k1 + k1'))) (beta ^ k2') else 0%Z)
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z
(k2' <= k2 - k1')%Z
beta:radix
n, k1, k2, k1', k2':Z
Hk1':(0 <= k1' <= k2)%Z
Hk2':(k2' < 0)%Z

(k2' <= k2 - k1')%Z
omega. Qed.
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> Zslice (n * beta ^ k) k1 k2 = Zslice n (k1 - k) k2
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> Zslice (n * beta ^ k) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z

Zslice (n * beta ^ k) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z

(if (0 <=? k2)%Z then Z.rem (Zscale (n * beta ^ k) (- k1)) (beta ^ k2) else 0%Z) = (if (0 <=? k2)%Z then Z.rem (Zscale n (- (k1 - k))) (beta ^ k2) else 0%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk2:(0 <= k2)%Z

Z.rem (Zscale (n * beta ^ k) (- k1)) (beta ^ k2) = Z.rem (Zscale n (- (k1 - k))) (beta ^ k2)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk2:(k2 < 0)%Z
0%Z = 0%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk2:(0 <= k2)%Z

Z.rem (Zscale (n * beta ^ k) (- k1)) (beta ^ k2) = Z.rem (Zscale n (- (k1 - k))) (beta ^ k2)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk2:(0 <= k2)%Z

Z.rem (Zscale n (k + - k1)) (beta ^ k2) = Z.rem (Zscale n (- (k1 - k))) (beta ^ k2)
now replace (- (k1 - k))%Z with (k + -k1)%Z by ring. Qed.
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> (0 <= k1)%Z -> Zslice (n ÷ beta ^ k) k1 k2 = Zslice n (k1 + k) k2
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> (0 <= k1)%Z -> Zslice (n ÷ beta ^ k) k1 k2 = Zslice n (k1 + k) k2
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z

Zslice (n ÷ beta ^ k) k1 k2 = Zslice n (k1 + k) k2
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z

(if (0 <=? k2)%Z then Z.rem (Zscale (n ÷ beta ^ k) (- k1)) (beta ^ k2) else 0%Z) = (if (0 <=? k2)%Z then Z.rem (Zscale n (- (k1 + k))) (beta ^ k2) else 0%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z

Z.rem (Zscale (n ÷ beta ^ k) (- k1)) (beta ^ k2) = Z.rem (Zscale n (- (k1 + k))) (beta ^ k2)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(k2 < 0)%Z
0%Z = 0%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z

Z.rem (Zscale (n ÷ beta ^ k) (- k1)) (beta ^ k2) = Z.rem (Zscale n (- (k1 + k))) (beta ^ k2)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z

Zscale (n ÷ beta ^ k) (- k1) = Zscale n (- (k1 + k))
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z

(if (0 <=? - k1)%Z then (n ÷ beta ^ k * beta ^ (- k1))%Z else (n ÷ beta ^ k ÷ beta ^ (- - k1))%Z) = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z

(n ÷ beta ^ k * beta ^ (- k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z

(n ÷ beta ^ k * beta ^ (- 0))%Z = (if (0 <=? - (0 + k))%Z then (n * beta ^ (- (0 + k)))%Z else (n ÷ beta ^ (- - (0 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(0 <= - (0 + k))%Z

(n ÷ beta ^ k * beta ^ (- 0))%Z = (n * beta ^ (- (0 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(- (0 + k) < 0)%Z
(n ÷ beta ^ k * beta ^ (- 0))%Z = (n ÷ beta ^ (- - (0 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(0 <= - (0 + k))%Z

(n ÷ beta ^ 0 * beta ^ (- 0))%Z = (n * beta ^ (- (0 + 0)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(- (0 + k) < 0)%Z
(n ÷ beta ^ k * beta ^ (- 0))%Z = (n ÷ beta ^ (- - (0 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(0 <= - (0 + k))%Z

(n ÷ 1 * 1)%Z = (n * 1)%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(- (0 + k) < 0)%Z
(n ÷ beta ^ k * beta ^ (- 0))%Z = (n ÷ beta ^ (- - (0 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(- (0 + k) < 0)%Z

(n ÷ beta ^ k * beta ^ (- 0))%Z = (n ÷ beta ^ (- - (0 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(0 <= - k1)%Z
Hk':(- (0 + k) < 0)%Z

(n ÷ beta ^ k * beta ^ (- 0))%Z = (n ÷ beta ^ (0 + k))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z
(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z

(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (if (0 <=? - (k1 + k))%Z then (n * beta ^ (- (k1 + k)))%Z else (n ÷ beta ^ (- - (k1 + k)))%Z)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z

(n ÷ beta ^ k ÷ beta ^ (- - k1))%Z = (n ÷ beta ^ (- - (k1 + k)))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z

(n ÷ beta ^ k ÷ beta ^ k1)%Z = (n ÷ beta ^ (k + k1))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
Hk1:(0 <= k1)%Z
Hk2:(0 <= k2)%Z
Hk1':(- k1 < 0)%Z

(n ÷ beta ^ k ÷ beta ^ k1)%Z = (n ÷ (beta ^ k * beta ^ k1))%Z
apply Zquot_Zquot. Qed.
beta:radix

forall n k k1 k2 : Z, (0 <= k1)%Z -> Zslice (Zscale n k) k1 k2 = Zslice n (k1 - k) k2
beta:radix

forall n k k1 k2 : Z, (0 <= k1)%Z -> Zslice (Zscale n k) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z

Zslice (Zscale n k) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z

Zslice (if (0 <=? k)%Z then (n * beta ^ k)%Z else (n ÷ beta ^ (- k))%Z) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z
Hk:(0 <= k)%Z

Zslice (n * beta ^ k) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z
Hk:(k < 0)%Z
Zslice (n ÷ beta ^ (- k)) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z
Hk:(k < 0)%Z

Zslice (n ÷ beta ^ (- k)) k1 k2 = Zslice n (k1 - k) k2
beta:radix
n, k, k1, k2:Z
Hk1:(0 <= k1)%Z
Hk:(k < 0)%Z

(0 <= - k)%Z
omega. Qed.
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> Zslice (n ÷ beta ^ k) k1 k2 = Zscale (Zslice n k (k1 + k2)) (- k1)
beta:radix

forall n k k1 k2 : Z, (0 <= k)%Z -> Zslice (n ÷ beta ^ k) k1 k2 = Zscale (Zslice n k (k1 + k2)) (- k1)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z

Zslice (n ÷ beta ^ k) k1 k2 = Zscale (Zslice n k (k1 + k2)) (- k1)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z

forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k0 = Zdigit (Zscale (Zslice n k (k1 + k2)) (- k1)) k0
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zscale (Zslice n k (k1 + k2)) (- k1)) k'
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k' - - k1)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k' + - - k1)
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k2 <= k')%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k2 <= k')%Z

0%Z = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k2 <= k')%Z

Zdigit (Zslice n k (k1 + k2)) (k1 + k') = 0%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k2 <= k')%Z

(k1 + k2 <= k1 + k')%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z

Zdigit (Zslice (n ÷ beta ^ k) k1 k2) k' = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z

Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(0 <= k1 + k')%Z

Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(k1 + k' < 0)%Z
Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(0 <= k1 + k')%Z

Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit n (k + (k1 + k'))
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(k1 + k' < 0)%Z
Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(0 <= k1 + k')%Z

Zdigit n (k1 + k' + k) = Zdigit n (k + (k1 + k'))
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(k1 + k' < 0)%Z
Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(0 <= k1 + k')%Z

(k1 + k' + k)%Z = (k + (k1 + k'))%Z
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(k1 + k' < 0)%Z
Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
beta:radix
n, k, k1, k2:Z
Hk:(0 <= k)%Z
k':Z
Hk':(0 <= k')%Z
Hk2:(k' < k2)%Z
Hk1':(k1 + k' < 0)%Z

Zdigit (n ÷ beta ^ k) (k1 + k') = Zdigit (Zslice n k (k1 + k2)) (k1 + k')
now rewrite 2!Zdigit_lt. Qed.
beta:radix

forall n k l1 l2 : Z, (0 <= l1)%Z -> (0 <= l2)%Z -> (Zslice n k l1 + Zscale (Zslice n (k + l1) l2) l1)%Z = Zslice n k (l1 + l2)
beta:radix

forall n k l1 l2 : Z, (0 <= l1)%Z -> (0 <= l2)%Z -> (Zslice n k l1 + Zscale (Zslice n (k + l1) l2) l1)%Z = Zslice n k (l1 + l2)
beta:radix
n, k1, l1, l2:Z
Hl1:(0 <= l1)%Z
Hl2:(0 <= l2)%Z

(Zslice n k1 l1 + Zscale (Zslice n (k1 + l1) l2) l1)%Z = Zslice n k1 (l1 + l2)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z

(Zslice n k1 l1 + Zscale (Zslice n (k1 + l1) l2) l1)%Z = Zslice n k1 (l1 + l2)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z

forall k : Z, (0 <= k)%Z -> Zdigit (Zslice n k1 l1 + Zscale (Zslice n (k1 + l1) l2) l1) k = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

Zdigit (Zslice n k1 l1 + Zscale (Zslice n (k1 + l1) l2) l1) k = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k)%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(l1 + l2 <= k)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(l1 + l2 <= k)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit (Zslice n k1 (l1 + l2)) k
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(l1 <= k)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(l1 <= k)%Z

(0 + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(l1 <= k)%Z

(0 + Zdigit n (k1 + l1 + (k - l1)))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(l1 <= k)%Z

(k1 + l1 + (k - l1))%Z = (k1 + k)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z
(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z

(Zdigit (Zslice n k1 l1) k + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z

(Zdigit n (k1 + k) + Zdigit (Zslice n (k1 + l1) l2) (k - l1))%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk2:(k < l1 + l2)%Z
Hk1:(k < l1)%Z

(Zdigit n (k1 + k) + 0)%Z = Zdigit n (k1 + k)
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= Zslice n k1 l1 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= Zscale (Zslice n (k1 + l1) l2) l1 * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

n = 0%Z -> Zslice n k1 l1 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zscale (Zslice n (k1 + l1) l2) l1 * n)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
H:n = 0%Z

Zslice 0 k1 l1 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zscale (Zslice n (k1 + l1) l2) l1 * n)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= Zscale (Zslice n (k1 + l1) l2) l1 * n)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= n * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

Zslice n (k1 + l1) l2 = 0%Z -> Zscale (Zslice n (k1 + l1) l2) l1 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n (k1 + l1) l2)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n (k1 + l1) l2 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
H:Zslice n (k1 + l1) l2 = 0%Z

Zscale 0 l1 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n (k1 + l1) l2)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n (k1 + l1) l2 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= n * Zslice n (k1 + l1) l2)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= Zslice n (k1 + l1) l2 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= Zslice n (k1 + l1) l2 * Zscale (Zslice n (k1 + l1) l2) l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

(0 <= n * Zslice n k1 l1)%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

forall k0 : Z, (0 <= k0)%Z -> Zdigit (Zslice n k1 l1) k0 = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k0 = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zscale (Zslice n (k1 + l1) l2) l1) k = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z

Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(l1 <= k)%Z

Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(k < l1)%Z
Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(l1 <= k)%Z

Zdigit (Zslice n k1 l1) k = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(k < l1)%Z
Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(k < l1)%Z

Zdigit (Zslice n k1 l1) k = 0%Z \/ Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(k < l1)%Z

Zdigit (Zslice n (k1 + l1) l2) (k - l1) = 0%Z
beta:radix
n, k1, l1, l2:Z
Hl2:(0 <= l2)%Z
k:Z
Hk:(0 <= k)%Z
Hk1:(k < l1)%Z

(k - l1 < 0)%Z
omega. Qed. Section digits_aux. Variable p : Z. Fixpoint Zdigits_aux (nb pow : Z) (n : nat) { struct n } : Z := match n with | O => nb | S n => if Zlt_bool p pow then nb else Zdigits_aux (nb + 1) (Zmult beta pow) n end. End digits_aux.
Number of digits of an integer
Definition Zdigits n :=
  match n with
  | Z0 => Z0
  | Zneg p => Zdigits_aux (Zpos p) 1 beta (digits2_Pnat p)
  | Zpos p => Zdigits_aux n 1 beta (digits2_Pnat p)
  end.

beta:radix

forall n : Z, (beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
beta:radix

forall n : Z, (beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
beta:radix

(forall p : positive, (beta ^ (Zdigits (Z.pos p) - 1) <= Z.pos p < beta ^ Zdigits (Z.pos p))%Z) -> forall n : Z, (beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
beta:radix
forall p : positive, (beta ^ (Zdigits (Z.pos p) - 1) <= Z.pos p < beta ^ Zdigits (Z.pos p))%Z
beta:radix
H:forall p : positive, (beta ^ (Zdigits (Z.pos p) - 1) <= Z.pos p < beta ^ Zdigits (Z.pos p))%Z

(beta ^ (Zdigits 0 - 1) <= Z.abs 0 < beta ^ Zdigits 0)%Z
beta:radix
forall p : positive, (beta ^ (Zdigits (Z.pos p) - 1) <= Z.pos p < beta ^ Zdigits (Z.pos p))%Z
beta:radix

forall p : positive, (beta ^ (Zdigits (Z.pos p) - 1) <= Z.pos p < beta ^ Zdigits (Z.pos p))%Z
beta:radix
n:positive

(beta ^ (Zdigits (Z.pos n) - 1) <= Z.pos n < beta ^ Zdigits (Z.pos n))%Z
beta:radix
n:positive

(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
(* *)
beta:radix
n:positive

(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Zpower_nat 2 (S (digits2_Pnat n)) <= beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Zpower_nat 2 (S (digits2_Pnat n)) <= Zpower_nat beta (Z.abs_nat (Z.of_nat (S (digits2_Pnat n)))))%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Zpower_nat 2 (S (digits2_Pnat n)) <= Zpower_nat beta (S (digits2_Pnat n)))%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Zpower_nat 2 0 <= Zpower_nat beta 0)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(Zpower_nat 2 (S n0) <= Zpower_nat beta (S n0))%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(Zpower_nat 2 (S n0) <= Zpower_nat beta (S n0))%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(2 * Zpower_nat 2 n0 <= beta * Zpower_nat beta n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(2 <= beta)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= 2)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= Zpower_nat 2 n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(2 <=? beta)%Z = true
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= 2)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= Zpower_nat 2 n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(0 <= 2)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= Zpower_nat 2 n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(0 <= Zpower_nat 2 n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(0 <= Zpower_nat 2 (Z.abs_nat (Z.of_nat n0)))%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(0 <= 2 ^ Z.of_nat n0)%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z
(0 <= Z.of_nat n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
n0:nat
IHn0:(Zpower_nat 2 n0 <= Zpower_nat beta n0)%Z

(0 <= Z.of_nat n0)%Z
beta:radix
n:positive
(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(0 <= Z.of_nat (S (digits2_Pnat n)))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive
U:(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z

(beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
(* *)
beta:radix
n:positive

(Z.pos n < beta ^ Z.of_nat (S (digits2_Pnat n)))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Z.pos n < beta ^ Z.succ (Z.of_nat (digits2_Pnat n)))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

(Z.pos n < beta ^ (Z.of_nat (digits2_Pnat n) + 1))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta (digits2_Pnat n))%Z
beta:radix
n:positive

forall n0 : nat, (Z.pos n < beta ^ (Z.of_nat n0 + 1))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 beta n0 - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta n0)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z

(beta ^ (Zdigits_aux (Z.pos n) 1 beta u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 beta u)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z

(beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z

(beta ^ (1 - 1) <= Z.pos n)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z
V:(beta ^ (1 - 1) <= Z.pos n)%Z
(beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z
V:(beta ^ (1 - 1) <= Z.pos n)%Z

(beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat
U:(Z.pos n < beta ^ (Z.of_nat u + 1))%Z
V:(beta ^ (1 - 1) <= Z.pos n)%Z

(beta ^ (1 - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat

(beta ^ (1 - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat

(1 <= 1)%Z -> (beta ^ (1 - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1))%Z -> (beta ^ (Zdigits_aux (Z.pos n) 1 (beta ^ 1) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) 1 (beta ^ 1) u)%Z
beta:radix
n:positive
u:nat

forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
(* *)
beta:radix
n:positive

forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat 0 + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) 0 - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) 0)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat (S u) + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) (S u) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) (S u))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z

forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat (S u) + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) (S u) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) (S u))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z

forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) (S u) - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) (S u))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z

forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + z))%Z -> (beta ^ ((if Z.pos n <? beta ^ z then z else Zdigits_aux (Z.pos n) (z + 1) (beta * beta ^ z) u) - 1) <= Z.pos n < beta ^ (if Z.pos n <? beta ^ z then z else Zdigits_aux (Z.pos n) (z + 1) (beta * beta ^ z) u))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z

(beta ^ ((if Z.pos n <? beta ^ v then v else Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u) - 1) <= Z.pos n < beta ^ (if Z.pos n <? beta ^ v then v else Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(Z.pos n < beta ^ v)%Z

(beta ^ (v - 1) <= Z.pos n < beta ^ v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(beta ^ (Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) (v + 1) (beta * beta ^ v) u)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (Zdigits_aux (Z.pos n) (v + 1) (beta ^ 1 * beta ^ v) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) (v + 1) (beta ^ 1 * beta ^ v) u)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (Zdigits_aux (Z.pos n) (v + 1) (beta ^ (1 + v)) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) (v + 1) (beta ^ (1 + v)) u)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (Zdigits_aux (Z.pos n) (1 + v) (beta ^ (1 + v)) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) (1 + v) (beta ^ (1 + v)) u)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(1 <= 1 + v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(beta ^ (1 + v - 1) <= Z.pos n < beta ^ (Z.of_nat u + (1 + v)))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (1 + v - 1) <= Z.pos n < beta ^ (Z.of_nat u + (1 + v)))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(beta ^ (1 + v - 1) <= Z.pos n)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(Z.pos n < beta ^ (Z.of_nat u + (1 + v)))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(Z.pos n < beta ^ (Z.of_nat u + (1 + v)))%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(0 <= 1)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z
(0 <= v)%Z
beta:radix
n:positive
u:nat
IHu:forall z : Z, (1 <= z)%Z -> (beta ^ (z - 1) <= Z.pos n < beta ^ (Z.of_nat u + z))%Z -> (beta ^ (Zdigits_aux (Z.pos n) z (beta ^ z) u - 1) <= Z.pos n < beta ^ Zdigits_aux (Z.pos n) z (beta ^ z) u)%Z
v:Z
Hv:(1 <= v)%Z
U:(beta ^ (v - 1) <= Z.pos n < beta ^ (Z.of_nat u + 1 + v))%Z
K:(beta ^ v <= Z.pos n)%Z

(0 <= v)%Z
apply Zle_succ_le with (1 := Hv). Qed.
beta:radix

forall n d : Z, (beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z -> Zdigits n = d
beta:radix

forall n d : Z, (beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z -> Zdigits n = d
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z

Zdigits n = d
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z

Zdigits n = d
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z

(Zdigits n <= d)%Z
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
(d <= Zdigits n)%Z
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z

(beta ^ (Zdigits n - 1) < beta ^ d)%Z
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
(d <= Zdigits n)%Z
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z

(d <= Zdigits n)%Z
beta:radix
n, d:Z
Hd:(beta ^ (d - 1) <= Z.abs n < beta ^ d)%Z
Hd':(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z

(beta ^ (d - 1) < beta ^ Zdigits n)%Z
now apply Z.le_lt_trans with (Z.abs n). Qed.
beta:radix

forall n : Z, Zdigits (Z.abs n) = Zdigits n
beta:radix

forall n : Z, Zdigits (Z.abs n) = Zdigits n
now intros [|n|n]. Qed.
beta:radix

forall n : Z, n <> 0%Z -> (0 < Zdigits n)%Z
beta:radix

forall n : Z, n <> 0%Z -> (0 < Zdigits n)%Z
beta:radix
n:Z
Zn:n <> 0%Z

(0 < Zdigits n)%Z
beta:radix
n:Z
Zn:n <> 0%Z

(0 < Zdigits (Z.abs n))%Z
beta:radix
n:Z
Zn:n <> 0%Z

(0 < Z.abs n)%Z
beta:radix
n:Z
Zn:n <> 0%Z
Hn:(0 < Z.abs n)%Z
(0 < Zdigits (Z.abs n))%Z
beta:radix
Zn:0%Z <> 0%Z

(0 < Z.abs 0)%Z
beta:radix
n:Z
Zn:n <> 0%Z
Hn:(0 < Z.abs n)%Z
(0 < Zdigits (Z.abs n))%Z
beta:radix
n:Z
Zn:n <> 0%Z
Hn:(0 < Z.abs n)%Z

(0 < Zdigits (Z.abs n))%Z
beta:radix
p:positive

(0 < Zdigits (Z.pos p))%Z
beta:radix
p:positive

(0 < Zdigits_aux (Z.pos p) 1 beta (digits2_Pnat p))%Z
beta:radix
p:positive

forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 (digits2_Pnat p))%Z
beta:radix
p:positive

forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 0)%Z
beta:radix
p:positive
n:nat
IHn:forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 n)%Z
forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 (S n))%Z
beta:radix
p:positive
n:nat
IHn:forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 n)%Z

forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 (S n))%Z
beta:radix
p:positive
n:nat
IHn:forall z z0 : Z, (0 < z)%Z -> (0 < Zdigits_aux (Z.pos p) z z0 n)%Z

forall z z0 : Z, (0 < z)%Z -> (0 < (if Z.pos p <? z0 then z else Zdigits_aux (Z.pos p) (z + 1) (beta * z0) n))%Z
beta:radix
p:positive
n:nat
IHn:forall z1 z2 : Z, (0 < z1)%Z -> (0 < Zdigits_aux (Z.pos p) z1 z2 n)%Z
z, z0:Z
H:(0 < z)%Z

(0 < (if Z.pos p <? z0 then z else Zdigits_aux (Z.pos p) (z + 1) (beta * z0) n))%Z
beta:radix
p:positive
n:nat
IHn:forall z1 z2 : Z, (0 < z1)%Z -> (0 < Zdigits_aux (Z.pos p) z1 z2 n)%Z
z, z0:Z
H:(0 < z)%Z

(0 < z)%Z
beta:radix
p:positive
n:nat
IHn:forall z1 z2 : Z, (0 < z1)%Z -> (0 < Zdigits_aux (Z.pos p) z1 z2 n)%Z
z, z0:Z
H:(0 < z)%Z
(0 < Zdigits_aux (Z.pos p) (z + 1) (beta * z0) n)%Z
beta:radix
p:positive
n:nat
IHn:forall z1 z2 : Z, (0 < z1)%Z -> (0 < Zdigits_aux (Z.pos p) z1 z2 n)%Z
z, z0:Z
H:(0 < z)%Z

(0 < Zdigits_aux (Z.pos p) (z + 1) (beta * z0) n)%Z
beta:radix
p:positive
n:nat
IHn:forall z1 z2 : Z, (0 < z1)%Z -> (0 < Zdigits_aux (Z.pos p) z1 z2 n)%Z
z, z0:Z
H:(0 < z)%Z

(0 < z + 1)%Z
now apply Zlt_lt_succ. Qed.
beta:radix

forall n : Z, (0 <= Zdigits n)%Z
beta:radix

forall n : Z, (0 <= Zdigits n)%Z
beta:radix
n:Z

(0 <= Zdigits n)%Z
beta:radix
n:Z
H:n = 0%Z

(0 <= Zdigits n)%Z
beta:radix
n:Z
H:n <> 0%Z
(0 <= Zdigits n)%Z
beta:radix
n:Z
H:n <> 0%Z

(0 <= Zdigits n)%Z
beta:radix
n:Z
H:n <> 0%Z

(0 < Zdigits n)%Z
now apply Zdigits_gt_0. Qed.
beta:radix

forall n k : Z, (Zdigits n <= k)%Z -> Zdigit n k = 0%Z
beta:radix

forall n k : Z, (Zdigits n <= k)%Z -> Zdigit n k = 0%Z
beta:radix
n, k:Z
Hk:(Zdigits n <= k)%Z

Zdigit n k = 0%Z
beta:radix
n, k:Z
Hk:(Zdigits n <= k)%Z

(Z.abs n < beta ^ Zdigits n)%Z
apply Zdigits_correct. Qed.
beta:radix

forall n : Z, n <> 0%Z -> Zdigit n (Zdigits n - 1) <> 0%Z
beta:radix

forall n : Z, n <> 0%Z -> Zdigit n (Zdigits n - 1) <> 0%Z
beta:radix
n:Z
Zn:n <> 0%Z

Zdigit n (Zdigits n - 1) <> 0%Z
beta:radix
n:Z
Zn:n <> 0%Z

(0 <= Zdigits n - 1)%Z
beta:radix
n:Z
Zn:n <> 0%Z
(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ (Zdigits n - 1 + 1))%Z
beta:radix
n:Z
Zn:n <> 0%Z

(0 < Zdigits n)%Z
beta:radix
n:Z
Zn:n <> 0%Z
(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ (Zdigits n - 1 + 1))%Z
beta:radix
n:Z
Zn:n <> 0%Z

(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ (Zdigits n - 1 + 1))%Z
beta:radix
n:Z
Zn:n <> 0%Z

(beta ^ (Zdigits n - 1) <= Z.abs n < beta ^ Zdigits n)%Z
apply Zdigits_correct. Qed.
beta:radix

forall n k l : Z, (0 <= l)%Z -> (Zdigits (Zslice n k l) <= l)%Z
beta:radix

forall n k l : Z, (0 <= l)%Z -> (Zdigits (Zslice n k l) <= l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z

(Zdigits (Zslice n k l) <= l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z

(Zdigits (if 0 <=? l then Z.rem (Zscale n (- k)) (beta ^ l) else 0) <= l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z

(Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) <= l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) <= l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) < beta ^ l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ l)%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < Z.abs (beta ^ l))%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(beta ^ l)%Z <> 0%Z
beta:radix
n, k, l:Z
Hl:(0 <= l)%Z
H1:(beta ^ (Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)) - 1) <= Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)))%Z
H2:(Z.abs (Z.rem (Zscale n (- k)) (beta ^ l)) < beta ^ Zdigits (Z.rem (Zscale n (- k)) (beta ^ l)))%Z

(0 < beta ^ l)%Z
now apply Zpower_gt_0. Qed.
beta:radix

forall m e : Z, m <> 0%Z -> (0 <= e)%Z -> Zdigits (m * beta ^ e) = (Zdigits m + e)%Z
beta:radix

forall m e : Z, m <> 0%Z -> (0 <= e)%Z -> Zdigits (m * beta ^ e) = (Zdigits m + e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z

Zdigits (m * beta ^ e) = (Zdigits m + e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

Zdigits (m * beta ^ e) = (Zdigits m + e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m + e - 1) <= Z.abs (m * beta ^ e) < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m + e - 1) <= Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= beta)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m + e - 1) <= Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m + e - 1) <= Z.abs m * beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m - 1 + e) <= Z.abs m * beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m - 1) * beta ^ e <= Z.abs m * beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m - 1) <= Z.abs m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(0 <= beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(0 <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(Z.abs m * beta ^ e < beta ^ (Zdigits m + e))%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(Z.abs m * beta ^ e < beta ^ Zdigits m * beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(0 < beta ^ e)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(Z.abs m < beta ^ Zdigits m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(Z.abs m < beta ^ Zdigits m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
(0 <= Zdigits m)%Z
beta:radix
m, e:Z
Hm:m <> 0%Z
He:(0 <= e)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(0 <= Zdigits m)%Z
now apply Zlt_le_weak, Zdigits_gt_0. Qed.
beta:radix

forall e : Z, (0 <= e)%Z -> Zdigits (beta ^ e) = (e + 1)%Z
beta:radix

forall e : Z, (0 <= e)%Z -> Zdigits (beta ^ e) = (e + 1)%Z
beta:radix
e:Z
He:(0 <= e)%Z

Zdigits (beta ^ e) = (e + 1)%Z
beta:radix
e:Z
He:(0 <= e)%Z

Zdigits (1 * beta ^ e) = (e + 1)%Z
beta:radix
e:Z
He:(0 <= e)%Z

(Zdigits 1 + e)%Z = (e + 1)%Z
apply Zplus_comm. Qed.
beta:radix

forall x y : Z, (0 <= x)%Z -> (x <= y)%Z -> (Zdigits x <= Zdigits y)%Z
beta:radix

forall x y : Z, (0 <= x)%Z -> (x <= y)%Z -> (Zdigits x <= Zdigits y)%Z
beta:radix
x, y:Z
Zx:(0 <= x)%Z
Hxy:(x <= y)%Z

(Zdigits x <= Zdigits y)%Z
beta:radix
x, y:Z
Zx:(0 <= x)%Z
Hxy:(x <= y)%Z
Hx:(beta ^ (Zdigits x - 1) <= Z.abs x < beta ^ Zdigits x)%Z

(Zdigits x <= Zdigits y)%Z
beta:radix
x, y:Z
Zx:(0 <= x)%Z
Hxy:(x <= y)%Z
Hx:(beta ^ (Zdigits x - 1) <= Z.abs x < beta ^ Zdigits x)%Z
Hy:(beta ^ (Zdigits y - 1) <= Z.abs y < beta ^ Zdigits y)%Z

(Zdigits x <= Zdigits y)%Z
beta:radix
x, y:Z
Zx:(0 <= x)%Z
Hxy:(x <= y)%Z
Hx:(beta ^ (Zdigits x - 1) <= Z.abs x < beta ^ Zdigits x)%Z
Hy:(beta ^ (Zdigits y - 1) <= Z.abs y < beta ^ Zdigits y)%Z

(beta ^ (Zdigits x - 1) < beta ^ Zdigits y)%Z
zify ; omega. Qed.
beta:radix

forall x y : Z, (0 <= y)%Z -> (Zdigits x < Zdigits y)%Z -> (x < y)%Z
beta:radix

forall x y : Z, (0 <= y)%Z -> (Zdigits x < Zdigits y)%Z -> (x < y)%Z
beta:radix
x, y:Z
Hy:(0 <= y)%Z

(Zdigits x < Zdigits y)%Z -> (x < y)%Z
beta:radix
x, y:Z
Hy:(0 <= y)%Z

((y <= x)%Z -> (Zdigits y <= Zdigits x)%Z) -> (Zdigits x < Zdigits y)%Z -> (x < y)%Z
beta:radix
x, y:Z
Hy:(0 <= y)%Z
(y <= x)%Z -> (Zdigits y <= Zdigits x)%Z
beta:radix
x, y:Z
Hy:(0 <= y)%Z

(y <= x)%Z -> (Zdigits y <= Zdigits x)%Z
now apply Zdigits_le. Qed.
beta:radix

forall e x : Z, (e < Zdigits x)%Z -> (beta ^ e <= Z.abs x)%Z
beta:radix

forall e x : Z, (e < Zdigits x)%Z -> (beta ^ e <= Z.abs x)%Z
beta:radix
e, x:Z
Hex:(e < Zdigits x)%Z

(beta ^ e <= Z.abs x)%Z
beta:radix
e, x:Z
Hex:(e < Zdigits x)%Z
H1:(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
H2:(Z.abs x < beta ^ Zdigits x)%Z

(beta ^ e <= Z.abs x)%Z
beta:radix
e, x:Z
Hex:(e < Zdigits x)%Z
H1:(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
H2:(Z.abs x < beta ^ Zdigits x)%Z

(beta ^ e <= beta ^ (Zdigits x - 1))%Z
beta:radix
e, x:Z
Hex:(e < Zdigits x)%Z
H1:(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
H2:(Z.abs x < beta ^ Zdigits x)%Z

(e <= Zdigits x - 1)%Z
clear -Hex ; omega. Qed.
beta:radix

forall e x : Z, (Z.abs x < beta ^ e)%Z -> (Zdigits x <= e)%Z
beta:radix

forall e x : Z, (Z.abs x < beta ^ e)%Z -> (Zdigits x <= e)%Z
beta:radix
e, x:Z

(Z.abs x < beta ^ e)%Z -> (Zdigits x <= e)%Z
beta:radix
e, x:Z

((e < Zdigits x)%Z -> (beta ^ e <= Z.abs x)%Z) -> (Z.abs x < beta ^ e)%Z -> (Zdigits x <= e)%Z
omega. Qed.
beta:radix

forall e x : Z, (Zdigits x <= e)%Z -> (Z.abs x < beta ^ e)%Z
beta:radix

forall e x : Z, (Zdigits x <= e)%Z -> (Z.abs x < beta ^ e)%Z
beta:radix
e, x:Z
Hex:(Zdigits x <= e)%Z

(Z.abs x < beta ^ e)%Z
beta:radix
e, x:Z
Hex:(Zdigits x <= e)%Z
H1:(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
H2:(Z.abs x < beta ^ Zdigits x)%Z

(Z.abs x < beta ^ e)%Z
beta:radix
e, x:Z
Hex:(Zdigits x <= e)%Z
H1:(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
H2:(Z.abs x < beta ^ Zdigits x)%Z

(beta ^ Zdigits x <= beta ^ e)%Z
now apply Zpower_le. Qed.
beta:radix

forall e x : Z, (beta ^ e <= Z.abs x)%Z -> (e < Zdigits x)%Z
beta:radix

forall e x : Z, (beta ^ e <= Z.abs x)%Z -> (e < Zdigits x)%Z
beta:radix
e, x:Z
Hex:(beta ^ e <= Z.abs x)%Z

(e < Zdigits x)%Z
beta:radix
e, x:Z
Hex:(beta ^ e <= Z.abs x)%Z

((Zdigits x <= e)%Z -> (Z.abs x < beta ^ e)%Z) -> (e < Zdigits x)%Z
omega. Qed.
Number of digits of a product.
This strong version is needed for proofs of division and square root algorithms, since they involve operation remainders.
beta:radix

forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (Zdigits (x + y + x * y) <= Zdigits x + Zdigits y)%Z
beta:radix

forall x y : Z, (0 <= x)%Z -> (0 <= y)%Z -> (Zdigits (x + y + x * y) <= Zdigits x + Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(Zdigits (x + y + x * y) <= Zdigits x + Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(Z.abs (x + y + x * y) < beta ^ (Zdigits x + Zdigits y))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(x + y + x * y < beta ^ (Zdigits x + Zdigits y))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(x + y + x * y < (x + 1) * (y + 1))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
((x + 1) * (y + 1) <= beta ^ (Zdigits x + Zdigits y))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(x * y + x + y < x * y + x + y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
((x + 1) * (y + 1) <= beta ^ (Zdigits x + Zdigits y))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

((x + 1) * (y + 1) <= beta ^ (Zdigits x + Zdigits y))%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

((x + 1) * (y + 1) <= beta ^ Zdigits x * beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(x + 1 <= beta ^ Zdigits x)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(y + 1 <= beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(x < beta ^ Zdigits x)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(y + 1 <= beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(Z.abs x < beta ^ Zdigits x)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(y + 1 <= beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(y + 1 <= beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(y < beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(Z.abs y < beta ^ Zdigits y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 <= x + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 <= y + 1)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 + 0 + 0 <= x + y + x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 + 0 <= x + y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z
(0 <= x * y)%Z
beta:radix
x, y:Z
Hx:(0 <= x)%Z
Hy:(0 <= y)%Z

(0 <= x * y)%Z
now apply Zmult_le_0_compat. Qed.
beta:radix

forall x y : Z, (Zdigits (x * y) <= Zdigits x + Zdigits y)%Z
beta:radix

forall x y : Z, (Zdigits (x * y) <= Zdigits x + Zdigits y)%Z
beta:radix
x, y:Z

(Zdigits (x * y) <= Zdigits x + Zdigits y)%Z
beta:radix
x, y:Z

(Zdigits (Z.abs (x * y)) <= Zdigits x + Zdigits y)%Z
beta:radix
x, y:Z

(Zdigits (Z.abs (x * y)) <= Zdigits (Z.abs x) + Zdigits y)%Z
beta:radix
x, y:Z

(Zdigits (Z.abs (x * y)) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(Zdigits (Z.abs (x * y)) <= Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y))%Z
beta:radix
x, y:Z
(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(0 <= Z.abs (x * y))%Z
beta:radix
x, y:Z
(Z.abs (x * y) <= Z.abs x + Z.abs y + Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(Z.abs (x * y) <= Z.abs x + Z.abs y + Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(Z.abs x * Z.abs y <= Z.abs x + Z.abs y + Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(0 <= Z.abs x)%Z -> (0 <= Z.abs y)%Z -> (Z.abs x * Z.abs y <= Z.abs x + Z.abs y + Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
beta:radix
x, y:Z

(Zdigits (Z.abs x + Z.abs y + Z.abs x * Z.abs y) <= Zdigits (Z.abs x) + Zdigits (Z.abs y))%Z
apply Zdigits_mult_strong ; apply Zabs_pos. Qed.
beta:radix

forall x y : Z, x <> 0%Z -> y <> 0%Z -> (Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z
beta:radix

forall x y : Z, x <> 0%Z -> y <> 0%Z -> (Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits x - 1 + (Zdigits y - 1) < Zdigits (x * y))%Z -> (Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 + (Zdigits y - 1) < Zdigits (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits x - 1 + (Zdigits y - 1) < Zdigits (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(beta ^ (Zdigits x - 1 + (Zdigits y - 1)) <= Z.abs (x * y))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(beta ^ (Zdigits x - 1 + (Zdigits y - 1)) <= Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(beta ^ (Zdigits x - 1) * beta ^ (Zdigits y - 1) <= Z.abs x * Z.abs y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(beta ^ (Zdigits x - 1) <= Z.abs x)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(beta ^ (Zdigits y - 1) <= Z.abs y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits x - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits x - 1 < Zdigits x)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(beta ^ (Zdigits y - 1) <= Z.abs y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits x - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(beta ^ (Zdigits y - 1) <= Z.abs y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits x - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits y - 1 < Zdigits y)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits x - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(0 <= beta ^ (Zdigits x - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(0 <= beta ^ (Zdigits y - 1))%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(x <> 0%Z -> (0 < Zdigits x)%Z) -> (Zdigits x - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z
(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(Zdigits y - 1 >= 0)%Z
beta:radix
x, y:Z
Zx:x <> 0%Z
Zy:y <> 0%Z

(y <> 0%Z -> (0 < Zdigits y)%Z) -> (Zdigits y - 1 >= 0)%Z
omega. Qed.
beta:radix

forall m e : Z, (0 <= m)%Z -> (0 <= e <= Zdigits m)%Z -> Zdigits (m / beta ^ e) = (Zdigits m - e)%Z
beta:radix

forall m e : Z, (0 <= m)%Z -> (0 <= e <= Zdigits m)%Z -> Zdigits (m / beta ^ e) = (Zdigits m - e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z

Zdigits (m / beta ^ e) = (Zdigits m - e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

Zdigits (m / beta ^ e) = (Zdigits m - e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - e - 1) <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - 1 - e) <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - 1) / beta ^ e <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
beta <> 0%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= e <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - 1) / beta ^ e <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= e <= Zdigits m - 1)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ (Zdigits m - 1) / beta ^ e <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ e > 0)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(m / beta ^ e < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(0 < beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m / beta ^ e * beta ^ e < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(m / beta ^ e * beta ^ e < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(m / beta ^ e * beta ^ e <= m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ e * (m / beta ^ e) <= m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ e > 0)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(m < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(m < beta ^ (Zdigits m - e) * beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(m < beta ^ (Zdigits m - e + e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= Zdigits m - e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(0 <= Zdigits m - e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(0 <= e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z
(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(0 <= m / beta ^ e)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H1:(beta ^ (Zdigits m - 1) <= m)%Z
H2:(m < beta ^ Zdigits m)%Z
He':(e < Zdigits m)%Z

(beta ^ e > 0)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(beta ^ (Zdigits m - e - 1) <= Z.abs (m / beta ^ e) < beta ^ (Zdigits m - e))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(beta ^ (Zdigits m - Zdigits m - 1) <= Z.abs (m / beta ^ Zdigits m) < beta ^ (Zdigits m - Zdigits m))%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(beta ^ (0 - 1) <= Z.abs (m / beta ^ Zdigits m) < beta ^ 0)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(0 <= Z.abs (m / beta ^ Zdigits m) < 1)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(0 <= Z.abs 0 < 1)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(0 <= m < beta ^ Zdigits m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(0 <= m < beta ^ Zdigits m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(0 <= m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m
(m < beta ^ Zdigits m)%Z
beta:radix
m, e:Z
Hm:(0 <= m)%Z
He:(0 <= e <= Zdigits m)%Z
H:(beta ^ (Zdigits m - 1) <= Z.abs m < beta ^ Zdigits m)%Z
He':e = Zdigits m

(m < beta ^ Zdigits m)%Z
now rewrite <- (Z.abs_eq m) at 1. Qed. End Fcore_digits.
Specialized version for computing the number of bits of an integer
Section Zdigits2.


forall m : positive, Z.of_nat (S (digits2_Pnat m)) = Zdigits radix2 (Z.pos m)

forall m : positive, Z.of_nat (S (digits2_Pnat m)) = Zdigits radix2 (Z.pos m)
m:positive

Z.of_nat (S (digits2_Pnat m)) = Zdigits radix2 (Z.pos m)
m:positive

(radix2 ^ (Z.of_nat (S (digits2_Pnat m)) - 1) <= Z.abs (Z.pos m) < radix2 ^ Z.of_nat (S (digits2_Pnat m)))%Z
m:positive

(radix2 ^ (Z.of_nat (S (digits2_Pnat m)) - 1) <= Z.abs (Z.pos m) < Zpower_nat radix2 (S (digits2_Pnat m)))%Z
m:positive

(radix2 ^ (Z.succ (Z.of_nat (digits2_Pnat m)) - 1) <= Z.abs (Z.pos m) < Zpower_nat radix2 (S (digits2_Pnat m)))%Z
m:positive

(radix2 ^ Z.pred (Z.succ (Z.of_nat (digits2_Pnat m))) <= Z.abs (Z.pos m) < Zpower_nat radix2 (S (digits2_Pnat m)))%Z
m:positive

(radix2 ^ Z.of_nat (digits2_Pnat m) <= Z.abs (Z.pos m) < Zpower_nat radix2 (S (digits2_Pnat m)))%Z
m:positive

(Zpower_nat radix2 (digits2_Pnat m) <= Z.abs (Z.pos m) < Zpower_nat radix2 (S (digits2_Pnat m)))%Z
apply digits2_Pnat_correct. Qed.

forall m : positive, Z.pos (SpecFloatCopy.digits2_pos m) = Zdigits radix2 (Z.pos m)

forall m : positive, Z.pos (SpecFloatCopy.digits2_pos m) = Zdigits radix2 (Z.pos m)
m:positive

Z.pos (SpecFloatCopy.digits2_pos m) = Zdigits radix2 (Z.pos m)
m:positive

Z.pos (SpecFloatCopy.digits2_pos m) = Z.of_nat (S (digits2_Pnat m))
m:positive

Z.pos (SpecFloatCopy.digits2_pos m) = Z.pos (Pos.of_succ_nat (digits2_Pnat m))
m:positive

SpecFloatCopy.digits2_pos m = Pos.of_succ_nat (digits2_Pnat m)
induction m ; simpl ; try easy ; apply f_equal, IHm. Qed.

forall n : Z, SpecFloatCopy.Zdigits2 n = Zdigits radix2 n

forall n : Z, SpecFloatCopy.Zdigits2 n = Zdigits radix2 n
intros [|p|p] ; try easy ; apply Zpos_digits2_pos. Qed. End Zdigits2.