apply Zmod_minus_km. assumption. fold (0 * 0). apply Zmult_lt_0_compat; omega. Qed.

Lemma Zdiv_mult_plus : forall a b m : Z, 0 < m -> 0 <= b -> b < m -> (a * m + b) / m = a.
intros. rewrite Zplus_comm. rewrite Z_div_plus. rewrite Zdiv_small_0. ring.