(** This is theorem 5.1 from Granlund and Montgomery, PLDI 1994. *)

Lemma Zquot_mul:
forall m l,
l >= 0 ->
two_p (N+l) < m * d <= two_p (N+l) + two_p l ->
forall n,
- two_p N <= n < two_p N ->
Z.quot n d = Z.div (m * n) (two_p (N + l)) + (if zlt n 0 then 1 else 0).