# CMPSCI 250 Discussion #4: Infinitely Many Primes

#### 27 February/1 March 2006

Notation: S is a finite set of naturals, all other variables denote naturals, P(x) means "x is prime", P3(x) means "x is prime and x is congruent to 3 (mod 4)", D(u,v) means "u divides v".
1. I: (proved on the board) ∀a:∃b:(a<b)∧P(b)
• Let a be an arbitrary natural.
• Let z be a! + 1 (where "!" is the factorial function)
• Claim 1: ∀q:(2≤q≤a)→¬D(q,z)
• Proof of Claim 1: Let q be arbitrary and assume 2≤q≤a.
• Since q is one of the numbers multiplied to make a!, a! is congruent to 1 (mod q) and thus a!+1 is congruent to 1 (mod q)
• Since q≥2, we know D(q,z) is false.
• Claim 2: ∀y:(y>1)→[∃p:P(p)∧D(p,z)]
• We have argued this informally in lecture. Note p=z is possible.
• Specialize Claim 2 to z and let p be the resulting natural. So P(p) and D(p,z) are true. Note z>1 because a!≥1.
• Specialize Claim 1 to p. So (2≤p≤a)→¬D(p,z).
• Since D(p,z) is true, by Modus Tollens, ¬(2≤p≤a).
• Since p<2 is ruled out by p being prime, we have that p>a.
• By Existence, ∃b:(a<b)∧P(b).
• By Generalization, we are done.
2. II: ∀S[∀x:(x∈S)→P(x)]→ [∃y:P(y)∧(y∉S)]
• Let S be an arbitrary finite set.
• Assume that all elements of S are primes.
• Let d be the product of all the elements of S.
• Note that for every x in S, d ≡ 0 (mod x) because x is one of the numbers multiplied together to get d.
• Let z = d+1.
• By Claim 2 above, let p be a natural such that P(p) and D(p,z).
• For any x in S, z ≡ 1 (mod x).
• Thus p cannot be any of the numbers in S.
• By Existence, ∃y:P(y) ∧ (y∉S).
• By Generalization, ∀S:∃y:P(y) ∧ (y∉S)
3. III: ∀S[∀x:(x∈S)→P3(x)]→ [∃y:P3(y)∧(y∉S)]
• Let S be an arbitrary finite set.
• Assume that S consists entirely of P3 primes.
• Let d be the product of all the elements of S.
• First assume that there are an even number of elements of S.
• By arithmetic, d ≡ 1 (mod 4).
• Let z be d + 2.
• So z ≡ 3 (mod 4)
• We know (as informally argued in lecture) that z is the product of primes.
• If any of these primes were 2, we could not have z ≡ 3 (mod 4).
• If all the primes dividing z were P1 primes, we would have z ≡ 1 (mod 4).
• So there exists a P3 prime dividing z -- call it p.
• As above in II, p cannot be an element of S since none of those elements divide z. (If x is in S, z ≡ 2 (mod x) and since x is a P3 prime, ¬D(x,z).)
• So we have ∃y:P3(y) ∧ (y∉S) in this case.
• Now, for the other case, assume that there are an odd number of elements in S.
• Now d ≡ 3 (mod 4).
• Let z = d + 4, so z ≡ 3 (mod 4).
• Just as in the other case, we prove that there exists p such that P3(p) and (p∉S). (This time, we have z ≡ 4 (mod x) for any x in S.)
• So in this case as well we have ∃y:P3(y) ∧ (y∉S).
• By Generalization, ∀S:∃y:P3(y) ∧ (y∉S).