ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  pockthi GIF version

Theorem pockthi 12358
Description: Pocklington's theorem, which gives a sufficient criterion for a number ๐‘ to be prime. This is the preferred method for verifying large primes, being much more efficient to compute than trial division. This form has been optimized for application to specific large primes; see pockthg 12357 for a more general closed-form version. (Contributed by Mario Carneiro, 2-Mar-2014.)
Hypotheses
Ref Expression
pockthi.p ๐‘ƒ โˆˆ โ„™
pockthi.g ๐บ โˆˆ โ„•
pockthi.m ๐‘€ = (๐บ ยท ๐‘ƒ)
pockthi.n ๐‘ = (๐‘€ + 1)
pockthi.d ๐ท โˆˆ โ„•
pockthi.e ๐ธ โˆˆ โ„•
pockthi.a ๐ด โˆˆ โ„•
pockthi.fac ๐‘€ = (๐ท ยท (๐‘ƒโ†‘๐ธ))
pockthi.gt ๐ท < (๐‘ƒโ†‘๐ธ)
pockthi.mod ((๐ดโ†‘๐‘€) mod ๐‘) = (1 mod ๐‘)
pockthi.gcd (((๐ดโ†‘๐บ) โˆ’ 1) gcd ๐‘) = 1
Assertion
Ref Expression
pockthi ๐‘ โˆˆ โ„™

Proof of Theorem pockthi
Dummy variables ๐‘ฅ ๐‘ฆ are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 pockthi.d . 2 ๐ท โˆˆ โ„•
2 pockthi.p . . . . . 6 ๐‘ƒ โˆˆ โ„™
3 prmnn 12112 . . . . . 6 (๐‘ƒ โˆˆ โ„™ โ†’ ๐‘ƒ โˆˆ โ„•)
42, 3ax-mp 5 . . . . 5 ๐‘ƒ โˆˆ โ„•
5 pockthi.e . . . . . 6 ๐ธ โˆˆ โ„•
65nnnn0i 9186 . . . . 5 ๐ธ โˆˆ โ„•0
7 nnexpcl 10535 . . . . 5 ((๐‘ƒ โˆˆ โ„• โˆง ๐ธ โˆˆ โ„•0) โ†’ (๐‘ƒโ†‘๐ธ) โˆˆ โ„•)
84, 6, 7mp2an 426 . . . 4 (๐‘ƒโ†‘๐ธ) โˆˆ โ„•
98a1i 9 . . 3 (๐ท โˆˆ โ„• โ†’ (๐‘ƒโ†‘๐ธ) โˆˆ โ„•)
10 id 19 . . 3 (๐ท โˆˆ โ„• โ†’ ๐ท โˆˆ โ„•)
11 pockthi.gt . . . 4 ๐ท < (๐‘ƒโ†‘๐ธ)
1211a1i 9 . . 3 (๐ท โˆˆ โ„• โ†’ ๐ท < (๐‘ƒโ†‘๐ธ))
13 pockthi.n . . . . 5 ๐‘ = (๐‘€ + 1)
14 pockthi.fac . . . . . . 7 ๐‘€ = (๐ท ยท (๐‘ƒโ†‘๐ธ))
151nncni 8931 . . . . . . . 8 ๐ท โˆˆ โ„‚
168nncni 8931 . . . . . . . 8 (๐‘ƒโ†‘๐ธ) โˆˆ โ„‚
1715, 16mulcomi 7965 . . . . . . 7 (๐ท ยท (๐‘ƒโ†‘๐ธ)) = ((๐‘ƒโ†‘๐ธ) ยท ๐ท)
1814, 17eqtri 2198 . . . . . 6 ๐‘€ = ((๐‘ƒโ†‘๐ธ) ยท ๐ท)
1918oveq1i 5887 . . . . 5 (๐‘€ + 1) = (((๐‘ƒโ†‘๐ธ) ยท ๐ท) + 1)
2013, 19eqtri 2198 . . . 4 ๐‘ = (((๐‘ƒโ†‘๐ธ) ยท ๐ท) + 1)
2120a1i 9 . . 3 (๐ท โˆˆ โ„• โ†’ ๐‘ = (((๐‘ƒโ†‘๐ธ) ยท ๐ท) + 1))
22 prmdvdsexpb 12151 . . . . . . 7 ((๐‘ฅ โˆˆ โ„™ โˆง ๐‘ƒ โˆˆ โ„™ โˆง ๐ธ โˆˆ โ„•) โ†’ (๐‘ฅ โˆฅ (๐‘ƒโ†‘๐ธ) โ†” ๐‘ฅ = ๐‘ƒ))
232, 5, 22mp3an23 1329 . . . . . 6 (๐‘ฅ โˆˆ โ„™ โ†’ (๐‘ฅ โˆฅ (๐‘ƒโ†‘๐ธ) โ†” ๐‘ฅ = ๐‘ƒ))
24 pockthi.m . . . . . . . . . . . . 13 ๐‘€ = (๐บ ยท ๐‘ƒ)
25 pockthi.g . . . . . . . . . . . . . 14 ๐บ โˆˆ โ„•
2625, 4nnmulcli 8943 . . . . . . . . . . . . 13 (๐บ ยท ๐‘ƒ) โˆˆ โ„•
2724, 26eqeltri 2250 . . . . . . . . . . . 12 ๐‘€ โˆˆ โ„•
2827nncni 8931 . . . . . . . . . . 11 ๐‘€ โˆˆ โ„‚
29 ax-1cn 7906 . . . . . . . . . . 11 1 โˆˆ โ„‚
3028, 29, 13mvrraddi 8176 . . . . . . . . . 10 (๐‘ โˆ’ 1) = ๐‘€
3130oveq2i 5888 . . . . . . . . 9 (๐ดโ†‘(๐‘ โˆ’ 1)) = (๐ดโ†‘๐‘€)
3231oveq1i 5887 . . . . . . . 8 ((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = ((๐ดโ†‘๐‘€) mod ๐‘)
33 pockthi.mod . . . . . . . . 9 ((๐ดโ†‘๐‘€) mod ๐‘) = (1 mod ๐‘)
34 peano2nn 8933 . . . . . . . . . . . . 13 (๐‘€ โˆˆ โ„• โ†’ (๐‘€ + 1) โˆˆ โ„•)
3527, 34ax-mp 5 . . . . . . . . . . . 12 (๐‘€ + 1) โˆˆ โ„•
3613, 35eqeltri 2250 . . . . . . . . . . 11 ๐‘ โˆˆ โ„•
37 nnq 9635 . . . . . . . . . . 11 (๐‘ โˆˆ โ„• โ†’ ๐‘ โˆˆ โ„š)
3836, 37ax-mp 5 . . . . . . . . . 10 ๐‘ โˆˆ โ„š
3927nngt0i 8951 . . . . . . . . . . . 12 0 < ๐‘€
4027nnrei 8930 . . . . . . . . . . . . 13 ๐‘€ โˆˆ โ„
41 1re 7958 . . . . . . . . . . . . 13 1 โˆˆ โ„
42 ltaddpos2 8412 . . . . . . . . . . . . 13 ((๐‘€ โˆˆ โ„ โˆง 1 โˆˆ โ„) โ†’ (0 < ๐‘€ โ†” 1 < (๐‘€ + 1)))
4340, 41, 42mp2an 426 . . . . . . . . . . . 12 (0 < ๐‘€ โ†” 1 < (๐‘€ + 1))
4439, 43mpbi 145 . . . . . . . . . . 11 1 < (๐‘€ + 1)
4544, 13breqtrri 4032 . . . . . . . . . 10 1 < ๐‘
46 q1mod 10358 . . . . . . . . . 10 ((๐‘ โˆˆ โ„š โˆง 1 < ๐‘) โ†’ (1 mod ๐‘) = 1)
4738, 45, 46mp2an 426 . . . . . . . . 9 (1 mod ๐‘) = 1
4833, 47eqtri 2198 . . . . . . . 8 ((๐ดโ†‘๐‘€) mod ๐‘) = 1
4932, 48eqtri 2198 . . . . . . 7 ((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1
50 oveq2 5885 . . . . . . . . . . . 12 (๐‘ฅ = ๐‘ƒ โ†’ ((๐‘ โˆ’ 1) / ๐‘ฅ) = ((๐‘ โˆ’ 1) / ๐‘ƒ))
5125nncni 8931 . . . . . . . . . . . . . . 15 ๐บ โˆˆ โ„‚
524nncni 8931 . . . . . . . . . . . . . . 15 ๐‘ƒ โˆˆ โ„‚
5351, 52mulcomi 7965 . . . . . . . . . . . . . 14 (๐บ ยท ๐‘ƒ) = (๐‘ƒ ยท ๐บ)
5430, 24, 533eqtrri 2203 . . . . . . . . . . . . 13 (๐‘ƒ ยท ๐บ) = (๐‘ โˆ’ 1)
5536nncni 8931 . . . . . . . . . . . . . . 15 ๐‘ โˆˆ โ„‚
5655, 29subcli 8235 . . . . . . . . . . . . . 14 (๐‘ โˆ’ 1) โˆˆ โ„‚
574nnap0i 8952 . . . . . . . . . . . . . 14 ๐‘ƒ # 0
5856, 52, 51, 57divmulapi 8725 . . . . . . . . . . . . 13 (((๐‘ โˆ’ 1) / ๐‘ƒ) = ๐บ โ†” (๐‘ƒ ยท ๐บ) = (๐‘ โˆ’ 1))
5954, 58mpbir 146 . . . . . . . . . . . 12 ((๐‘ โˆ’ 1) / ๐‘ƒ) = ๐บ
6050, 59eqtrdi 2226 . . . . . . . . . . 11 (๐‘ฅ = ๐‘ƒ โ†’ ((๐‘ โˆ’ 1) / ๐‘ฅ) = ๐บ)
6160oveq2d 5893 . . . . . . . . . 10 (๐‘ฅ = ๐‘ƒ โ†’ (๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) = (๐ดโ†‘๐บ))
6261oveq1d 5892 . . . . . . . . 9 (๐‘ฅ = ๐‘ƒ โ†’ ((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) = ((๐ดโ†‘๐บ) โˆ’ 1))
6362oveq1d 5892 . . . . . . . 8 (๐‘ฅ = ๐‘ƒ โ†’ (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = (((๐ดโ†‘๐บ) โˆ’ 1) gcd ๐‘))
64 pockthi.gcd . . . . . . . 8 (((๐ดโ†‘๐บ) โˆ’ 1) gcd ๐‘) = 1
6563, 64eqtrdi 2226 . . . . . . 7 (๐‘ฅ = ๐‘ƒ โ†’ (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1)
66 pockthi.a . . . . . . . . 9 ๐ด โˆˆ โ„•
6766nnzi 9276 . . . . . . . 8 ๐ด โˆˆ โ„ค
68 oveq1 5884 . . . . . . . . . . . 12 (๐‘ฆ = ๐ด โ†’ (๐‘ฆโ†‘(๐‘ โˆ’ 1)) = (๐ดโ†‘(๐‘ โˆ’ 1)))
6968oveq1d 5892 . . . . . . . . . . 11 (๐‘ฆ = ๐ด โ†’ ((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = ((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘))
7069eqeq1d 2186 . . . . . . . . . 10 (๐‘ฆ = ๐ด โ†’ (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โ†” ((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1))
71 oveq1 5884 . . . . . . . . . . . . 13 (๐‘ฆ = ๐ด โ†’ (๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) = (๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)))
7271oveq1d 5892 . . . . . . . . . . . 12 (๐‘ฆ = ๐ด โ†’ ((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) = ((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1))
7372oveq1d 5892 . . . . . . . . . . 11 (๐‘ฆ = ๐ด โ†’ (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘))
7473eqeq1d 2186 . . . . . . . . . 10 (๐‘ฆ = ๐ด โ†’ ((((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1 โ†” (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1))
7570, 74anbi12d 473 . . . . . . . . 9 (๐‘ฆ = ๐ด โ†’ ((((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1) โ†” (((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1)))
7675rspcev 2843 . . . . . . . 8 ((๐ด โˆˆ โ„ค โˆง (((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1)) โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1))
7767, 76mpan 424 . . . . . . 7 ((((๐ดโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐ดโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1) โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1))
7849, 65, 77sylancr 414 . . . . . 6 (๐‘ฅ = ๐‘ƒ โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1))
7923, 78biimtrdi 163 . . . . 5 (๐‘ฅ โˆˆ โ„™ โ†’ (๐‘ฅ โˆฅ (๐‘ƒโ†‘๐ธ) โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1)))
8079rgen 2530 . . . 4 โˆ€๐‘ฅ โˆˆ โ„™ (๐‘ฅ โˆฅ (๐‘ƒโ†‘๐ธ) โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1))
8180a1i 9 . . 3 (๐ท โˆˆ โ„• โ†’ โˆ€๐‘ฅ โˆˆ โ„™ (๐‘ฅ โˆฅ (๐‘ƒโ†‘๐ธ) โ†’ โˆƒ๐‘ฆ โˆˆ โ„ค (((๐‘ฆโ†‘(๐‘ โˆ’ 1)) mod ๐‘) = 1 โˆง (((๐‘ฆโ†‘((๐‘ โˆ’ 1) / ๐‘ฅ)) โˆ’ 1) gcd ๐‘) = 1)))
829, 10, 12, 21, 81pockthg 12357 . 2 (๐ท โˆˆ โ„• โ†’ ๐‘ โˆˆ โ„™)
831, 82ax-mp 5 1 ๐‘ โˆˆ โ„™
Colors of variables: wff set class
Syntax hints:   โ†’ wi 4   โˆง wa 104   โ†” wb 105   = wceq 1353   โˆˆ wcel 2148  โˆ€wral 2455  โˆƒwrex 2456   class class class wbr 4005  (class class class)co 5877  โ„cr 7812  0cc0 7813  1c1 7814   + caddc 7816   ยท cmul 7818   < clt 7994   โˆ’ cmin 8130   / cdiv 8631  โ„•cn 8921  โ„•0cn0 9178  โ„คcz 9255  โ„šcq 9621   mod cmo 10324  โ†‘cexp 10521   โˆฅ cdvds 11796   gcd cgcd 11945  โ„™cprime 12109
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 614  ax-in2 615  ax-io 709  ax-5 1447  ax-7 1448  ax-gen 1449  ax-ie1 1493  ax-ie2 1494  ax-8 1504  ax-10 1505  ax-11 1506  ax-i12 1507  ax-bndl 1509  ax-4 1510  ax-17 1526  ax-i9 1530  ax-ial 1534  ax-i5r 1535  ax-13 2150  ax-14 2151  ax-ext 2159  ax-coll 4120  ax-sep 4123  ax-nul 4131  ax-pow 4176  ax-pr 4211  ax-un 4435  ax-setind 4538  ax-iinf 4589  ax-cnex 7904  ax-resscn 7905  ax-1cn 7906  ax-1re 7907  ax-icn 7908  ax-addcl 7909  ax-addrcl 7910  ax-mulcl 7911  ax-mulrcl 7912  ax-addcom 7913  ax-mulcom 7914  ax-addass 7915  ax-mulass 7916  ax-distr 7917  ax-i2m1 7918  ax-0lt1 7919  ax-1rid 7920  ax-0id 7921  ax-rnegex 7922  ax-precex 7923  ax-cnre 7924  ax-pre-ltirr 7925  ax-pre-ltwlin 7926  ax-pre-lttrn 7927  ax-pre-apti 7928  ax-pre-ltadd 7929  ax-pre-mulgt0 7930  ax-pre-mulext 7931  ax-arch 7932  ax-caucvg 7933
This theorem depends on definitions:  df-bi 117  df-stab 831  df-dc 835  df-3or 979  df-3an 980  df-tru 1356  df-fal 1359  df-nf 1461  df-sb 1763  df-eu 2029  df-mo 2030  df-clab 2164  df-cleq 2170  df-clel 2173  df-nfc 2308  df-ne 2348  df-nel 2443  df-ral 2460  df-rex 2461  df-reu 2462  df-rmo 2463  df-rab 2464  df-v 2741  df-sbc 2965  df-csb 3060  df-dif 3133  df-un 3135  df-in 3137  df-ss 3144  df-nul 3425  df-if 3537  df-pw 3579  df-sn 3600  df-pr 3601  df-op 3603  df-uni 3812  df-int 3847  df-iun 3890  df-br 4006  df-opab 4067  df-mpt 4068  df-tr 4104  df-id 4295  df-po 4298  df-iso 4299  df-iord 4368  df-on 4370  df-ilim 4371  df-suc 4373  df-iom 4592  df-xp 4634  df-rel 4635  df-cnv 4636  df-co 4637  df-dm 4638  df-rn 4639  df-res 4640  df-ima 4641  df-iota 5180  df-fun 5220  df-fn 5221  df-f 5222  df-f1 5223  df-fo 5224  df-f1o 5225  df-fv 5226  df-isom 5227  df-riota 5833  df-ov 5880  df-oprab 5881  df-mpo 5882  df-1st 6143  df-2nd 6144  df-recs 6308  df-irdg 6373  df-frec 6394  df-1o 6419  df-2o 6420  df-oadd 6423  df-er 6537  df-en 6743  df-dom 6744  df-fin 6745  df-sup 6985  df-inf 6986  df-pnf 7996  df-mnf 7997  df-xr 7998  df-ltxr 7999  df-le 8000  df-sub 8132  df-neg 8133  df-reap 8534  df-ap 8541  df-div 8632  df-inn 8922  df-2 8980  df-3 8981  df-4 8982  df-n0 9179  df-xnn0 9242  df-z 9256  df-uz 9531  df-q 9622  df-rp 9656  df-fz 10011  df-fzo 10145  df-fl 10272  df-mod 10325  df-seqfrec 10448  df-exp 10522  df-ihash 10758  df-cj 10853  df-re 10854  df-im 10855  df-rsqrt 11009  df-abs 11010  df-clim 11289  df-proddc 11561  df-dvds 11797  df-gcd 11946  df-prm 12110  df-odz 12212  df-phi 12213  df-pc 12287
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator