(* This file is generated by Why3's Coq 8.4 driver *)
(* Beware! Only edit allowed sections below    *)
Require Import BuiltIn.
Require BuiltIn.
Require int.Int.
Require int.Abs.
Require int.ComputerDivision.

(* Why3 goal *)
Theorem mod_div_unique : forall (x:Z) (y:Z) (q:Z) (r:Z), ((0%Z <= x)%Z /\
  ((0%Z < y)%Z /\ ((x = ((q * y)%Z + r)%Z) /\ ((0%Z <= r)%Z /\
  (r < y)%Z)))) -> ((q = (ZArith.BinInt.Z.quot x y)) /\
  (r = (ZArith.BinInt.Z.rem x y))).
(* Why3 intros x y q r (h1,(h2,(h3,(h4,h5)))). *)
(* YOU MAY EDIT THE PROOF BELOW *)
intros x y q r (H1,(H2,(H3,(H4,H5)))).
apply Zquot.Zquot_mod_unique_full.
2: rewrite H3; ring.
red.
left.
rewrite Zabs_eq; auto with zarith.
Qed.

