rewrite Zplus_comm with (m := a mod m). rewrite Zplus_assoc. rewrite Z_mod_plus.
rewrite Zplus_comm. trivial. omega. rewrite Zdivmod_split. trivial. assumption. Qed.

Lemma Zmod_mult_distr_l : forall a b m : Z, 0 < m -> (a * b) mod m = (a mod m * b) mod m.
intros a b m H. replace (a * b) with ((a / m * m + a mod m) * b).