Module ZEuclid.
Definition modulo a b := Z.modulo a (Z.abs b).
Definition div a b := (Z.sgn b) * (Z.div a (Z.abs b)).
Instance mod_wd : Proper (eq==>eq==>eq) modulo.

Lemma mod_bound_pos a b : 0<=a -> 0<b -> 0 <= modulo a b < b.