(** Number of digits of a product.  This strong version is needed for proofs of division and square root algorithms, since they involve operation remainders. *)

(* Specifications: *)
Theorem Zdigits_mult_strong :
forall x y,
(0 <= x)%Z -> (0 <= y)%Z ->
(Zdigits (x + y + x * y) <= Zdigits x + Zdigits y)%Z.
Theorem Zdigits_mult :
forall x y,
(Zdigits (x * y) <= Zdigits x + Zdigits y)%Z.
Theorem Zdigits_mult_ge :
forall x y,
(x <> 0)%Z -> (y <> 0)%Z ->
(Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z.
Theorem Zdigits_div_Zpower :
forall m e,
(0 <= m)%Z ->
(0 <= e <= Zdigits m)%Z ->
Zdigits (m / Zpower beta e) = (Zdigits m - e)%Z.
Theorem Zdigits_mult_strong :
forall x y,
(0 <= x)%Z -> (0 <= y)%Z ->
(Zdigits (x + y + x * y) <= Zdigits x + Zdigits y)%Z.
Theorem Zdigits_mult :
forall x y,
(Zdigits (x * y) <= Zdigits x + Zdigits y)%Z.
Theorem Zdigits_mult_ge :
forall x y,
(x <> 0)%Z -> (y <> 0)%Z ->
(Zdigits x + Zdigits y - 1 <= Zdigits (x * y))%Z.
Theorem Zdigits_div_Zpower :
forall m e,
(0 <= m)%Z ->
(0 <= e <= Zdigits m)%Z ->
Zdigits (m / Zpower beta e) = (Zdigits m - e)%Z.