(** * Less than or equal to predicate

  - arities: (1,1)
*)

Definition le_e : BC :=
  comp 1 1 lt_e (proj 1 0 0 :: nil) (comp 1 1 succ_e nil (proj 1 1 1 :: nil) :: nil).(** * Minus

  - arities: (2,0)
*)

Notation minus_e := (inv_e (from_11_to_20 minus_rev_e)) (only parsing).(** * Euclidean division

  - arities: (2,0)
*)

Fixpoint div' (q y:nat)(x:nat) : nat :=
  match q with
  | 0 => 0
  | S q' => if leb (q' * y) x then q' else div' q' y x
  end.

(* Specifications: *)
Lemma div'_coq_correct : forall (q x y : nat) (Hy:y>0), (q > proj1_sig (quotient y Hy x) -> div' q y x = proj1_sig (quotient y Hy x)) /\ (q <= proj1_sig (quotient y Hy x) -> div' q y x = Peano.pred q).