MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  pockthg Structured version   Visualization version   GIF version

Theorem pockthg 16770
Description: The generalized Pocklington's theorem. If 𝑁 − 1 = 𝐴 · 𝐵 where 𝐵 < 𝐴, then 𝑁 is prime if and only if for every prime factor 𝑝 of 𝐴, there is an 𝑥 such that 𝑥↑(𝑁 − 1) = 1( mod 𝑁) and gcd (𝑥↑((𝑁 − 1) / 𝑝) − 1, 𝑁) = 1. (Contributed by Mario Carneiro, 2-Mar-2014.)
Hypotheses
Ref Expression
pockthg.1 (𝜑𝐴 ∈ ℕ)
pockthg.2 (𝜑𝐵 ∈ ℕ)
pockthg.3 (𝜑𝐵 < 𝐴)
pockthg.4 (𝜑𝑁 = ((𝐴 · 𝐵) + 1))
pockthg.5 (𝜑 → ∀𝑝 ∈ ℙ (𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)))
Assertion
Ref Expression
pockthg (𝜑𝑁 ∈ ℙ)
Distinct variable groups:   𝑥,𝑝,𝑁   𝐴,𝑝,𝑥   𝜑,𝑝,𝑥
Allowed substitution hints:   𝐵(𝑥,𝑝)

Proof of Theorem pockthg
Dummy variable 𝑞 is distinct from all other variables.
StepHypRef Expression
1 pockthg.4 . . 3 (𝜑𝑁 = ((𝐴 · 𝐵) + 1))
2 pockthg.1 . . . . . . 7 (𝜑𝐴 ∈ ℕ)
3 pockthg.2 . . . . . . 7 (𝜑𝐵 ∈ ℕ)
42, 3nnmulcld 12202 . . . . . 6 (𝜑 → (𝐴 · 𝐵) ∈ ℕ)
5 nnuz 12798 . . . . . 6 ℕ = (ℤ‘1)
64, 5eleqtrdi 2848 . . . . 5 (𝜑 → (𝐴 · 𝐵) ∈ (ℤ‘1))
7 eluzp1p1 12787 . . . . 5 ((𝐴 · 𝐵) ∈ (ℤ‘1) → ((𝐴 · 𝐵) + 1) ∈ (ℤ‘(1 + 1)))
86, 7syl 17 . . . 4 (𝜑 → ((𝐴 · 𝐵) + 1) ∈ (ℤ‘(1 + 1)))
9 df-2 12212 . . . . 5 2 = (1 + 1)
109fveq2i 6842 . . . 4 (ℤ‘2) = (ℤ‘(1 + 1))
118, 10eleqtrrdi 2849 . . 3 (𝜑 → ((𝐴 · 𝐵) + 1) ∈ (ℤ‘2))
121, 11eqeltrd 2838 . 2 (𝜑𝑁 ∈ (ℤ‘2))
13 eluzelre 12770 . . . . . . . . 9 (𝑁 ∈ (ℤ‘2) → 𝑁 ∈ ℝ)
1412, 13syl 17 . . . . . . . 8 (𝜑𝑁 ∈ ℝ)
1514adantr 481 . . . . . . 7 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑁 ∈ ℝ)
162nnred 12164 . . . . . . . . 9 (𝜑𝐴 ∈ ℝ)
1716resqcld 14022 . . . . . . . 8 (𝜑 → (𝐴↑2) ∈ ℝ)
1817adantr 481 . . . . . . 7 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴↑2) ∈ ℝ)
19 prmnn 16542 . . . . . . . . . 10 (𝑞 ∈ ℙ → 𝑞 ∈ ℕ)
2019ad2antrl 726 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑞 ∈ ℕ)
2120nnred 12164 . . . . . . . 8 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑞 ∈ ℝ)
2221resqcld 14022 . . . . . . 7 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝑞↑2) ∈ ℝ)
23 pockthg.3 . . . . . . . . . . 11 (𝜑𝐵 < 𝐴)
243nnred 12164 . . . . . . . . . . . 12 (𝜑𝐵 ∈ ℝ)
252nngt0d 12198 . . . . . . . . . . . 12 (𝜑 → 0 < 𝐴)
26 ltmul2 12002 . . . . . . . . . . . 12 ((𝐵 ∈ ℝ ∧ 𝐴 ∈ ℝ ∧ (𝐴 ∈ ℝ ∧ 0 < 𝐴)) → (𝐵 < 𝐴 ↔ (𝐴 · 𝐵) < (𝐴 · 𝐴)))
2724, 16, 16, 25, 26syl112anc 1374 . . . . . . . . . . 11 (𝜑 → (𝐵 < 𝐴 ↔ (𝐴 · 𝐵) < (𝐴 · 𝐴)))
2823, 27mpbid 231 . . . . . . . . . 10 (𝜑 → (𝐴 · 𝐵) < (𝐴 · 𝐴))
292, 2nnmulcld 12202 . . . . . . . . . . 11 (𝜑 → (𝐴 · 𝐴) ∈ ℕ)
30 nnltp1le 12555 . . . . . . . . . . 11 (((𝐴 · 𝐵) ∈ ℕ ∧ (𝐴 · 𝐴) ∈ ℕ) → ((𝐴 · 𝐵) < (𝐴 · 𝐴) ↔ ((𝐴 · 𝐵) + 1) ≤ (𝐴 · 𝐴)))
314, 29, 30syl2anc 584 . . . . . . . . . 10 (𝜑 → ((𝐴 · 𝐵) < (𝐴 · 𝐴) ↔ ((𝐴 · 𝐵) + 1) ≤ (𝐴 · 𝐴)))
3228, 31mpbid 231 . . . . . . . . 9 (𝜑 → ((𝐴 · 𝐵) + 1) ≤ (𝐴 · 𝐴))
332nncnd 12165 . . . . . . . . . 10 (𝜑𝐴 ∈ ℂ)
3433sqvald 14040 . . . . . . . . 9 (𝜑 → (𝐴↑2) = (𝐴 · 𝐴))
3532, 1, 343brtr4d 5135 . . . . . . . 8 (𝜑𝑁 ≤ (𝐴↑2))
3635adantr 481 . . . . . . 7 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑁 ≤ (𝐴↑2))
37 pockthg.5 . . . . . . . . . . . . 13 (𝜑 → ∀𝑝 ∈ ℙ (𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)))
3837adantr 481 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → ∀𝑝 ∈ ℙ (𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)))
39 prmnn 16542 . . . . . . . . . . . . . . . . . . . 20 (𝑝 ∈ ℙ → 𝑝 ∈ ℕ)
4039ad2antrl 726 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 𝑝 ∈ ℕ)
4140nncnd 12165 . . . . . . . . . . . . . . . . . 18 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 𝑝 ∈ ℂ)
4241exp1d 14038 . . . . . . . . . . . . . . . . 17 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → (𝑝↑1) = 𝑝)
43 nnge1 12177 . . . . . . . . . . . . . . . . . . 19 ((𝑝 pCnt 𝐴) ∈ ℕ → 1 ≤ (𝑝 pCnt 𝐴))
4443ad2antll 727 . . . . . . . . . . . . . . . . . 18 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 1 ≤ (𝑝 pCnt 𝐴))
45 simprl 769 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 𝑝 ∈ ℙ)
462nnzd 12522 . . . . . . . . . . . . . . . . . . . 20 (𝜑𝐴 ∈ ℤ)
4746ad2antrr 724 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 𝐴 ∈ ℤ)
48 1nn0 12425 . . . . . . . . . . . . . . . . . . . 20 1 ∈ ℕ0
4948a1i 11 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 1 ∈ ℕ0)
50 pcdvdsb 16733 . . . . . . . . . . . . . . . . . . 19 ((𝑝 ∈ ℙ ∧ 𝐴 ∈ ℤ ∧ 1 ∈ ℕ0) → (1 ≤ (𝑝 pCnt 𝐴) ↔ (𝑝↑1) ∥ 𝐴))
5145, 47, 49, 50syl3anc 1371 . . . . . . . . . . . . . . . . . 18 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → (1 ≤ (𝑝 pCnt 𝐴) ↔ (𝑝↑1) ∥ 𝐴))
5244, 51mpbid 231 . . . . . . . . . . . . . . . . 17 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → (𝑝↑1) ∥ 𝐴)
5342, 52eqbrtrrd 5127 . . . . . . . . . . . . . . . 16 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → 𝑝𝐴)
54 simpl1 1191 . . . . . . . . . . . . . . . . . . . 20 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝜑)
5554, 2syl 17 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝐴 ∈ ℕ)
5654, 3syl 17 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝐵 ∈ ℕ)
5754, 23syl 17 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝐵 < 𝐴)
5854, 1syl 17 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝑁 = ((𝐴 · 𝐵) + 1))
59 simpl2l 1226 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝑞 ∈ ℙ)
60 simpl2r 1227 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝑞𝑁)
61 simpl3l 1228 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝑝 ∈ ℙ)
62 simpl3r 1229 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → (𝑝 pCnt 𝐴) ∈ ℕ)
63 simprl 769 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → 𝑥 ∈ ℤ)
64 simprrl 779 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → ((𝑥↑(𝑁 − 1)) mod 𝑁) = 1)
65 simprrr 780 . . . . . . . . . . . . . . . . . . 19 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)
6655, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65pockthlem 16769 . . . . . . . . . . . . . . . . . 18 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) ∧ (𝑥 ∈ ℤ ∧ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1))) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1)))
6766rexlimdvaa 3151 . . . . . . . . . . . . . . . . 17 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → (∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
68673expa 1118 . . . . . . . . . . . . . . . 16 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → (∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
6953, 68embantd 59 . . . . . . . . . . . . . . 15 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ (𝑝 ∈ ℙ ∧ (𝑝 pCnt 𝐴) ∈ ℕ)) → ((𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
7069expr 457 . . . . . . . . . . . . . 14 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → ((𝑝 pCnt 𝐴) ∈ ℕ → ((𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1)))))
71 id 22 . . . . . . . . . . . . . . . . . 18 (𝑝 ∈ ℙ → 𝑝 ∈ ℙ)
72 prmuz2 16564 . . . . . . . . . . . . . . . . . . . 20 (𝑞 ∈ ℙ → 𝑞 ∈ (ℤ‘2))
73 uz2m1nn 12840 . . . . . . . . . . . . . . . . . . . 20 (𝑞 ∈ (ℤ‘2) → (𝑞 − 1) ∈ ℕ)
7472, 73syl 17 . . . . . . . . . . . . . . . . . . 19 (𝑞 ∈ ℙ → (𝑞 − 1) ∈ ℕ)
7574ad2antrl 726 . . . . . . . . . . . . . . . . . 18 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝑞 − 1) ∈ ℕ)
76 pccl 16713 . . . . . . . . . . . . . . . . . 18 ((𝑝 ∈ ℙ ∧ (𝑞 − 1) ∈ ℕ) → (𝑝 pCnt (𝑞 − 1)) ∈ ℕ0)
7771, 75, 76syl2anr 597 . . . . . . . . . . . . . . . . 17 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → (𝑝 pCnt (𝑞 − 1)) ∈ ℕ0)
7877nn0ge0d 12472 . . . . . . . . . . . . . . . 16 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → 0 ≤ (𝑝 pCnt (𝑞 − 1)))
79 breq1 5106 . . . . . . . . . . . . . . . 16 ((𝑝 pCnt 𝐴) = 0 → ((𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1)) ↔ 0 ≤ (𝑝 pCnt (𝑞 − 1))))
8078, 79syl5ibrcom 246 . . . . . . . . . . . . . . 15 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → ((𝑝 pCnt 𝐴) = 0 → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
8180a1dd 50 . . . . . . . . . . . . . 14 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → ((𝑝 pCnt 𝐴) = 0 → ((𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1)))))
82 simpr 485 . . . . . . . . . . . . . . . 16 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → 𝑝 ∈ ℙ)
832ad2antrr 724 . . . . . . . . . . . . . . . 16 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → 𝐴 ∈ ℕ)
8482, 83pccld 16714 . . . . . . . . . . . . . . 15 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → (𝑝 pCnt 𝐴) ∈ ℕ0)
85 elnn0 12411 . . . . . . . . . . . . . . 15 ((𝑝 pCnt 𝐴) ∈ ℕ0 ↔ ((𝑝 pCnt 𝐴) ∈ ℕ ∨ (𝑝 pCnt 𝐴) = 0))
8684, 85sylib 217 . . . . . . . . . . . . . 14 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → ((𝑝 pCnt 𝐴) ∈ ℕ ∨ (𝑝 pCnt 𝐴) = 0))
8770, 81, 86mpjaod 858 . . . . . . . . . . . . 13 (((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) ∧ 𝑝 ∈ ℙ) → ((𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)) → (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
8887ralimdva 3162 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (∀𝑝 ∈ ℙ (𝑝𝐴 → ∃𝑥 ∈ ℤ (((𝑥↑(𝑁 − 1)) mod 𝑁) = 1 ∧ (((𝑥↑((𝑁 − 1) / 𝑝)) − 1) gcd 𝑁) = 1)) → ∀𝑝 ∈ ℙ (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
8938, 88mpd 15 . . . . . . . . . . 11 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → ∀𝑝 ∈ ℙ (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1)))
9075nnzd 12522 . . . . . . . . . . . 12 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝑞 − 1) ∈ ℤ)
91 pc2dvds 16743 . . . . . . . . . . . 12 ((𝐴 ∈ ℤ ∧ (𝑞 − 1) ∈ ℤ) → (𝐴 ∥ (𝑞 − 1) ↔ ∀𝑝 ∈ ℙ (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
9246, 90, 91syl2an2r 683 . . . . . . . . . . 11 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴 ∥ (𝑞 − 1) ↔ ∀𝑝 ∈ ℙ (𝑝 pCnt 𝐴) ≤ (𝑝 pCnt (𝑞 − 1))))
9389, 92mpbird 256 . . . . . . . . . 10 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝐴 ∥ (𝑞 − 1))
94 dvdsle 16184 . . . . . . . . . . 11 ((𝐴 ∈ ℤ ∧ (𝑞 − 1) ∈ ℕ) → (𝐴 ∥ (𝑞 − 1) → 𝐴 ≤ (𝑞 − 1)))
9546, 75, 94syl2an2r 683 . . . . . . . . . 10 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴 ∥ (𝑞 − 1) → 𝐴 ≤ (𝑞 − 1)))
9693, 95mpd 15 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝐴 ≤ (𝑞 − 1))
972nnnn0d 12469 . . . . . . . . . 10 (𝜑𝐴 ∈ ℕ0)
9820nnnn0d 12469 . . . . . . . . . 10 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑞 ∈ ℕ0)
99 nn0ltlem1 12559 . . . . . . . . . 10 ((𝐴 ∈ ℕ0𝑞 ∈ ℕ0) → (𝐴 < 𝑞𝐴 ≤ (𝑞 − 1)))
10097, 98, 99syl2an2r 683 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴 < 𝑞𝐴 ≤ (𝑞 − 1)))
10196, 100mpbird 256 . . . . . . . 8 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝐴 < 𝑞)
10216adantr 481 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝐴 ∈ ℝ)
10397nn0ge0d 12472 . . . . . . . . . 10 (𝜑 → 0 ≤ 𝐴)
104103adantr 481 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 0 ≤ 𝐴)
10598nn0ge0d 12472 . . . . . . . . 9 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 0 ≤ 𝑞)
106102, 21, 104, 105lt2sqd 14151 . . . . . . . 8 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴 < 𝑞 ↔ (𝐴↑2) < (𝑞↑2)))
107101, 106mpbid 231 . . . . . . 7 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝐴↑2) < (𝑞↑2))
10815, 18, 22, 36, 107lelttrd 11309 . . . . . 6 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → 𝑁 < (𝑞↑2))
10915, 22ltnled 11298 . . . . . 6 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → (𝑁 < (𝑞↑2) ↔ ¬ (𝑞↑2) ≤ 𝑁))
110108, 109mpbid 231 . . . . 5 ((𝜑 ∧ (𝑞 ∈ ℙ ∧ 𝑞𝑁)) → ¬ (𝑞↑2) ≤ 𝑁)
111110expr 457 . . . 4 ((𝜑𝑞 ∈ ℙ) → (𝑞𝑁 → ¬ (𝑞↑2) ≤ 𝑁))
112111con2d 134 . . 3 ((𝜑𝑞 ∈ ℙ) → ((𝑞↑2) ≤ 𝑁 → ¬ 𝑞𝑁))
113112ralrimiva 3141 . 2 (𝜑 → ∀𝑞 ∈ ℙ ((𝑞↑2) ≤ 𝑁 → ¬ 𝑞𝑁))
114 isprm5 16575 . 2 (𝑁 ∈ ℙ ↔ (𝑁 ∈ (ℤ‘2) ∧ ∀𝑞 ∈ ℙ ((𝑞↑2) ≤ 𝑁 → ¬ 𝑞𝑁)))
11512, 113, 114sylanbrc 583 1 (𝜑𝑁 ∈ ℙ)
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 396  wo 845  w3a 1087   = wceq 1541  wcel 2106  wral 3062  wrex 3071   class class class wbr 5103  cfv 6493  (class class class)co 7353  cr 11046  0cc0 11047  1c1 11048   + caddc 11050   · cmul 11052   < clt 11185  cle 11186  cmin 11381   / cdiv 11808  cn 12149  2c2 12204  0cn0 12409  cz 12495  cuz 12759   mod cmo 13766  cexp 13959  cdvds 16128   gcd cgcd 16366  cprime 16539   pCnt cpc 16700
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2707  ax-rep 5240  ax-sep 5254  ax-nul 5261  ax-pow 5318  ax-pr 5382  ax-un 7668  ax-cnex 11103  ax-resscn 11104  ax-1cn 11105  ax-icn 11106  ax-addcl 11107  ax-addrcl 11108  ax-mulcl 11109  ax-mulrcl 11110  ax-mulcom 11111  ax-addass 11112  ax-mulass 11113  ax-distr 11114  ax-i2m1 11115  ax-1ne0 11116  ax-1rid 11117  ax-rnegex 11118  ax-rrecex 11119  ax-cnre 11120  ax-pre-lttri 11121  ax-pre-lttrn 11122  ax-pre-ltadd 11123  ax-pre-mulgt0 11124  ax-pre-sup 11125
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 846  df-3or 1088  df-3an 1089  df-tru 1544  df-fal 1554  df-ex 1782  df-nf 1786  df-sb 2068  df-mo 2538  df-eu 2567  df-clab 2714  df-cleq 2728  df-clel 2814  df-nfc 2887  df-ne 2942  df-nel 3048  df-ral 3063  df-rex 3072  df-rmo 3351  df-reu 3352  df-rab 3406  df-v 3445  df-sbc 3738  df-csb 3854  df-dif 3911  df-un 3913  df-in 3915  df-ss 3925  df-pss 3927  df-nul 4281  df-if 4485  df-pw 4560  df-sn 4585  df-pr 4587  df-op 4591  df-uni 4864  df-int 4906  df-iun 4954  df-br 5104  df-opab 5166  df-mpt 5187  df-tr 5221  df-id 5529  df-eprel 5535  df-po 5543  df-so 5544  df-fr 5586  df-we 5588  df-xp 5637  df-rel 5638  df-cnv 5639  df-co 5640  df-dm 5641  df-rn 5642  df-res 5643  df-ima 5644  df-pred 6251  df-ord 6318  df-on 6319  df-lim 6320  df-suc 6321  df-iota 6445  df-fun 6495  df-fn 6496  df-f 6497  df-f1 6498  df-fo 6499  df-f1o 6500  df-fv 6501  df-riota 7309  df-ov 7356  df-oprab 7357  df-mpo 7358  df-om 7799  df-1st 7917  df-2nd 7918  df-frecs 8208  df-wrecs 8239  df-recs 8313  df-rdg 8352  df-1o 8408  df-2o 8409  df-oadd 8412  df-er 8644  df-en 8880  df-dom 8881  df-sdom 8882  df-fin 8883  df-sup 9374  df-inf 9375  df-dju 9833  df-card 9871  df-pnf 11187  df-mnf 11188  df-xr 11189  df-ltxr 11190  df-le 11191  df-sub 11383  df-neg 11384  df-div 11809  df-nn 12150  df-2 12212  df-3 12213  df-n0 12410  df-xnn0 12482  df-z 12496  df-uz 12760  df-q 12866  df-rp 12908  df-fz 13417  df-fzo 13560  df-fl 13689  df-mod 13767  df-seq 13899  df-exp 13960  df-hash 14223  df-cj 14976  df-re 14977  df-im 14978  df-sqrt 15112  df-abs 15113  df-dvds 16129  df-gcd 16367  df-prm 16540  df-odz 16629  df-phi 16630  df-pc 16701
This theorem is referenced by:  pockthi  16771  proththd  45738
  Copyright terms: Public domain W3C validator