(** * Primality on nat *)

Definition Prime (n : nat) : Prop :=
  n > 1 /\ (forall q : nat, Divides q n -> q = 1 \/ q = n).(** Prime with bounded all quantifier. *)

Definition bPrime (n : nat) :=
  n > 1 /\ (forall q : nat, q < S n -> Divides q n -> q = 1 \/ q = n).

(* Specifications: *)
Lemma primebprime : forall n : nat, Prime n <-> bPrime n.
Lemma bprimedec : forall n : nat, bPrime n \/ ~ bPrime n.
Lemma primedec : forall n : nat, Prime n \/ ~ Prime n.
Lemma nonprime_witness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d < n /\ Divides d n.
Lemma nonprime_sqrwitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n.
Theorem nonprime_primewitness : forall n : nat, n > 1 -> ~ Prime n -> exists d : nat, 1 < d /\ d * d <= n /\ Divides d n /\ Prime d.
Theorem primepropdiv : forall n : nat, n > 1 -> (forall q : nat, Prime q -> Divides q n -> q * q > n) -> Prime n.
Lemma primediv1p : forall p n : nat, Prime p -> Divides n p -> n = 1 \/ n = p.
Lemma prime2 : Prime 2.