proposition: Theorem Z_div_mod_full a b : b <> 0 -> let (q, r) := Z.div_eucl a b in a = b * q + r /\ Remainder r b.
proof: Proof. intros Hb. generalize (Z.div_eucl_eq a b Hb) (Z.mod_pos_bound a b) (Z.mod_neg_bound a b). unfold Z.modulo. destruct Z.div_eucl as (q,r). intros EQ POS NEG. split; auto. red; destruct b. - now destruct Hb. - left; now apply POS. - right; now apply NEG. Qed.
imports: ZArith_base Zbool ZArithRing Zcomplements Setoid Morphisms