Section Z_DIV_MUL.
Variable N: Z.      (**r number of relevant bits *)
Hypothesis N_pos: N >= 0.
Variable d: Z.      (**r divisor *)
Hypothesis d_pos: d > 0.
(** This is theorem 4.2 from Granlund and Montgomery, PLDI 1994. *)

Lemma Zdiv_mul_opp:
forall m l,
l >= 0 ->
two_p (N+l) < m * d <= two_p (N+l) + two_p l ->
forall n,
0 < n <= two_p N ->
Z.div n d = - Z.div (m * (-n)) (two_p (N + l)) - 1.