(** Divides with bounded ex quantifier. *)

(* Specifications: *)
Lemma divbdiv : forall n d : nat, Divides d n <-> bDivides d n.
(** Divides is decidable. *)
Lemma bdivdec : forall n d : nat, bDivides d n \/ ~ bDivides d n.
Lemma divdec : forall n d : nat, Divides d n \/ ~ Divides d n.
(** If d|n, then either d<sqrt(n) or the other divisor x<sqrt(n). *)
Theorem sqrdivbound :
forall n d : nat,
Divides d n ->
exists x : nat, Divides x n /\ x * x <= n /\ (x = d \/ d * x = n).