proposition: Lemma Zdiv_rest_correct (x:Z) (p:positive) : Zdiv_rest_proofs x p.
proof: Proof. generalize (Zdiv_rest_correct1 x p); generalize (Zdiv_rest_correct2 x p). destruct (Pos.iter Zdiv_rest_aux (x, 0, 1) p) as ((q,r),d). intros (H1,(H2,H3)) ->. now exists q r. Qed.
imports: Wf_nat ZArith_base Zcomplements Zpow_def