assumption. apply Zlt_le_trans with (2 ^ p). apply Zmod_lt_z_m. auto with a. apply Zle_pow_le. auto with a. cut (p < w). omega.
auto with a. Qed.

Lemma divmultmodM : forall a b : Z, (a * 2 ^ w + b) / 2 ^ p * 2 ^ p mod M = (a mod M * 2 ^ w + b) / 2 ^ p * 2 ^ p mod M.
intros a b. replace w with (w - p + p). rewrite Zpower_exp. rewrite Zmult_assoc. rewrite Zdiv_times_plus.