(************************************************************************)
(*         *      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 *)
(** The first signatures will be common to all divisions over NZ, N and Z *)
Module Type DivMod (Import A : Typ).
Parameters Inline div modulo : t -> t -> t.
End DivMod.
Module Type DivModNotation (A : Typ)(Import B : DivMod A).
Infix "/" := div.
Infix "mod" := modulo (at level 40, no associativity).
End DivModNotation.
Module Type DivMod' (A : Typ) := DivMod A <+ DivModNotation A.
Module Type NZDivSpec (Import A : NZOrdAxiomsSig')(Import B : DivMod' A).
#[global]
Declare Instance div_wd : Proper (eq==>eq==>eq) div.
#[global]
Declare Instance mod_wd : Proper (eq==>eq==>eq) modulo.

Axiom div_mod : forall a b, b ~= 0 -> a == b*(a/b) + (a mod b).