(* -*- coding: utf-8 -*- *)
(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** * Euclidean Division *)
(** Initial Contribution by Claude Marché and Xavier Urbain *)
Require Export ZArith_base.
Local Open Scope Z_scope.
(** The definition of the division is now in [BinIntDef], the initial specifications and properties are in [BinInt]. *)
#[deprecated(since="8.17",note="Use Coq.ZArith.BinIntDef.Z.pos_div_eucl instead")]
Notation Zdiv_eucl_POS := Z.pos_div_eucl (only parsing).
#[deprecated(since="8.17",note="Use Coq.ZArith.BinIntDef.Z.modulo instead")]
Notation Zmod := Z.modulo (only parsing).
#[deprecated(since="8.17",note="Use BinInt.Z.pos_div_eucl_bound instead")]
Notation Zmod_POS_bound := Z.pos_div_eucl_bound (only parsing).
#[deprecated(since="8.17",note="Use Coq.ZArith.BinInt.Z.mod_pos_bound instead")]
Notation Zmod_pos_bound := Z.mod_pos_bound (only parsing).
#[deprecated(since="8.17",note="Use Coq.ZArith.BinInt.Z.mod_neg_bound instead")]
Notation Zmod_neg_bound := Z.mod_neg_bound (only parsing).
(** * Main division theorems *)
(** NB: many things are stated twice for compatibility reasons *)

(* Specifications: *)
Lemma Z_div_mod_POS :
forall b:Z,
b > 0 ->
forall a:positive,
let (q, r) := Z.pos_div_eucl a b in Zpos a = b * q + r /\ 0 <= r < b.
Theorem Z_div_mod a b :
b > 0 ->
let (q, r) := Z.div_eucl a b in a = b * q + r /\ 0 <= r < b.