(************************************************************************)
(*         *      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 for integers (Floor convention)  We use here the convention known as Floor, or Round-Toward-Bottom, where [a/b] is the closest integer below the exact fraction. It can be summarized by:  [a = bq+r /\ 0 <= |r| < |b| /\ Sign(r) = Sign(b)]  This is the convention followed historically by [Z.div] in Coq, and corresponds to convention "F" in the following paper:  R. Boute, "The Euclidean definition of the functions div and mod", ACM Transactions on Programming Languages and Systems, Vol. 14, No.2, pp. 127-144, April 1992.  See files [ZDivTrunc] and [ZDivEucl] for others conventions. *)
Module Type ZDivProp
(Import A : ZAxiomsSig')
(Import B : ZMulOrderProp A)
(Import C : ZSgnAbsProp A B).
(** We benefit from what already exists for NZ *)
Module Import Private_NZDiv := Nop <+ NZDivProp A A B.
(** Another formulation of the main equation *)

(* Specifications: *)
Lemma mod_eq :
forall a b, b~=0 -> a mod b == a - b*(a/b).