Ltac zero_or_not a :=
  destruct (Z.eq_decidable a 0) as [->|?];
  [rewrite ?Zquot_0_l, ?Zrem_0_l, ?Zquot_0_r, ?Zrem_0_r;
   try lia;
   auto with zarith|].

(* Specifications: *)
Lemma Z_rem_same a : Z.rem a a = 0.
Lemma Z_rem_mult a b : Z.rem (a*b) b = 0.
Theorem Zquot_opp_l a b : (-a)÷b = -(a÷b).
Theorem Zquot_opp_r a b : a÷(-b) = -(a÷b).
Theorem Zrem_opp_l a b : Z.rem (-a) b = -(Z.rem a b).
Theorem Zrem_opp_r a b : Z.rem a (-b) = Z.rem a b.
Theorem Zquot_opp_opp a b : (-a)÷(-b) = a÷b.
Theorem Zrem_opp_opp a b : Z.rem (-a) (-b) = -(Z.rem a b).
Theorem Zrem_sgn a b : 0 <= Z.sgn (Z.rem a b) * Z.sgn a.
Theorem Zrem_sgn2 a b : 0 <= (Z.rem a b) * a.
Theorem Zrem_lt_pos a b : 0<=a -> b<>0 -> 0 <= Z.rem a b < Z.abs b.
Theorem Zrem_lt_neg a b : a<=0 -> b<>0 -> -Z.abs b < Z.rem a b <= 0.
Theorem Zrem_lt_pos_pos a b : 0<=a -> 0<b -> 0 <= Z.rem a b < b.
Theorem Zrem_lt_pos_neg a b : 0<=a -> b<0 -> 0 <= Z.rem a b < -b.
Theorem Zrem_lt_neg_pos a b : a<=0 -> 0<b -> -b < Z.rem a b <= 0.
Theorem Zrem_lt_neg_neg a b : a<=0 -> b<0 -> b < Z.rem a b <= 0.