Section RSA.
Variable p q : nat.
Variable prime_p : prime p.
Variable prime_q : prime q.
Variable neq_pq : p <> q.
Variable e d : nat.
Variable pq : nat.
Hypothesis pqnot_zero : pq <> 0.
Hypothesis pq_div_p : divides (p - 1) pq.
Hypothesis pq_div_q : divides (q - 1) pq.
Variable ed_inv : congruent pq (e * d) 1.
Definition encrypt (w : nat) : nat := power w e.
Definition decrypt (w : nat) : nat := power w d.

Lemma prime_2_or_more : forall r : nat, prime r -> r = 2 \/ 2 < r.