MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  isprm3 Structured version   Unicode version

Theorem isprm3 14208
Description: The predicate "is a prime number". A prime number is an integer greater than or equal to 2 with no divisors strictly between 1 and itself. (Contributed by Paul Chapman, 26-Oct-2012.)
Assertion
Ref Expression
isprm3  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  ( 2 ... ( P  -  1 ) )  -.  z  ||  P
) )
Distinct variable group:    z, P

Proof of Theorem isprm3
StepHypRef Expression
1 isprm2 14207 . 2  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
2 iman 424 . . . . . . 7  |-  ( ( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) )  <->  -.  ( z  e.  NN  /\  -.  (
z  =  1  \/  z  =  P ) ) )
3 eluz2nn 11130 . . . . . . . . . . . . . . . 16  |-  ( P  e.  ( ZZ>= `  2
)  ->  P  e.  NN )
4 nnz 10893 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  NN  ->  z  e.  ZZ )
5 dvdsle 14013 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( z  ||  P  ->  z  <_  P )
)
64, 5sylan 471 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  ( z  ||  P  ->  z  <_  P )
)
7 nnge1 10569 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  NN  ->  1  <_  z )
87adantr 465 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  1  <_  z )
96, 8jctild 543 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  ( z  ||  P  ->  ( 1  <_  z  /\  z  <_  P ) ) )
103, 9sylan2 474 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( z  ||  P  ->  ( 1  <_  z  /\  z  <_  P ) ) )
11 zre 10875 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  ZZ  ->  z  e.  RR )
12 nnre 10550 . . . . . . . . . . . . . . . . . 18  |-  ( P  e.  NN  ->  P  e.  RR )
13 1re 9598 . . . . . . . . . . . . . . . . . . . . . 22  |-  1  e.  RR
14 leltne 9677 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( 1  e.  RR  /\  z  e.  RR  /\  1  <_  z )  ->  (
1  <  z  <->  z  =/=  1 ) )
1513, 14mp3an1 1312 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ( z  e.  RR  /\  1  <_  z )  -> 
( 1  <  z  <->  z  =/=  1 ) )
16153adant2 1016 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( z  e.  RR  /\  P  e.  RR  /\  1  <_  z )  ->  (
1  <  z  <->  z  =/=  1 ) )
17163expia 1199 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( 1  <_  z  ->  ( 1  <  z  <->  z  =/=  1 ) ) )
18 leltne 9677 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( z  e.  RR  /\  P  e.  RR  /\  z  <_  P )  ->  (
z  <  P  <->  P  =/=  z ) )
19183expia 1199 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( z  <_  P  ->  ( z  <  P  <->  P  =/=  z ) ) )
2017, 19anim12d 563 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  <->  z  =/=  1 )  /\  (
z  <  P  <->  P  =/=  z ) ) ) )
2111, 12, 20syl2an 477 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  <->  z  =/=  1 )  /\  (
z  <  P  <->  P  =/=  z ) ) ) )
22 pm4.38 872 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( 1  <  z  <->  z  =/=  1 )  /\  ( z  <  P  <->  P  =/=  z ) )  ->  ( ( 1  <  z  /\  z  <  P )  <->  ( z  =/=  1  /\  P  =/=  z ) ) )
23 df-ne 2640 . . . . . . . . . . . . . . . . . . . 20  |-  ( z  =/=  1  <->  -.  z  =  1 )
24 nesym 2715 . . . . . . . . . . . . . . . . . . . 20  |-  ( P  =/=  z  <->  -.  z  =  P )
2523, 24anbi12i 697 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  =/=  1  /\  P  =/=  z )  <-> 
( -.  z  =  1  /\  -.  z  =  P ) )
26 ioran 490 . . . . . . . . . . . . . . . . . . 19  |-  ( -.  ( z  =  1  \/  z  =  P )  <->  ( -.  z  =  1  /\  -.  z  =  P )
)
2725, 26bitr4i 252 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  =/=  1  /\  P  =/=  z )  <->  -.  ( z  =  1  \/  z  =  P ) )
2822, 27syl6bb 261 . . . . . . . . . . . . . . . . 17  |-  ( ( ( 1  <  z  <->  z  =/=  1 )  /\  ( z  <  P  <->  P  =/=  z ) )  ->  ( ( 1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) )
2921, 28syl6 33 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) ) )
304, 3, 29syl2an 477 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) ) )
3110, 30syld 44 . . . . . . . . . . . . . 14  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( z  ||  P  ->  ( ( 1  < 
z  /\  z  <  P )  <->  -.  ( z  =  1  \/  z  =  P ) ) ) )
3231imp 429 . . . . . . . . . . . . 13  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  -.  ( z  =  1  \/  z  =  P ) ) )
33 eluzelz 11101 . . . . . . . . . . . . . . 15  |-  ( P  e.  ( ZZ>= `  2
)  ->  P  e.  ZZ )
34 1z 10901 . . . . . . . . . . . . . . . . . . . 20  |-  1  e.  ZZ
35 zltp1le 10920 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( 1  e.  ZZ  /\  z  e.  ZZ )  ->  ( 1  <  z  <->  ( 1  +  1 )  <_  z ) )
3634, 35mpan 670 . . . . . . . . . . . . . . . . . . 19  |-  ( z  e.  ZZ  ->  (
1  <  z  <->  ( 1  +  1 )  <_ 
z ) )
37 df-2 10601 . . . . . . . . . . . . . . . . . . . 20  |-  2  =  ( 1  +  1 )
3837breq1i 4444 . . . . . . . . . . . . . . . . . . 19  |-  ( 2  <_  z  <->  ( 1  +  1 )  <_ 
z )
3936, 38syl6bbr 263 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  ZZ  ->  (
1  <  z  <->  2  <_  z ) )
4039adantr 465 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( 1  <  z  <->  2  <_  z ) )
41 zltlem1 10923 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( z  <  P  <->  z  <_  ( P  - 
1 ) ) )
4240, 41anbi12d 710 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( 1  < 
z  /\  z  <  P )  <->  ( 2  <_ 
z  /\  z  <_  ( P  -  1 ) ) ) )
43 peano2zm 10914 . . . . . . . . . . . . . . . . 17  |-  ( P  e.  ZZ  ->  ( P  -  1 )  e.  ZZ )
44 2z 10903 . . . . . . . . . . . . . . . . . 18  |-  2  e.  ZZ
45 elfz 11689 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  ZZ  /\  2  e.  ZZ  /\  ( P  -  1 )  e.  ZZ )  -> 
( z  e.  ( 2 ... ( P  -  1 ) )  <-> 
( 2  <_  z  /\  z  <_  ( P  -  1 ) ) ) )
4644, 45mp3an2 1313 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  ( P  -  1
)  e.  ZZ )  ->  ( z  e.  ( 2 ... ( P  -  1 ) )  <->  ( 2  <_ 
z  /\  z  <_  ( P  -  1 ) ) ) )
4743, 46sylan2 474 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( z  e.  ( 2 ... ( P  -  1 ) )  <-> 
( 2  <_  z  /\  z  <_  ( P  -  1 ) ) ) )
4842, 47bitr4d 256 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
494, 33, 48syl2an 477 . . . . . . . . . . . . . 14  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5049adantr 465 . . . . . . . . . . . . 13  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5132, 50bitr3d 255 . . . . . . . . . . . 12  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( -.  ( z  =  1  \/  z  =  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5251anasss 647 . . . . . . . . . . 11  |-  ( ( z  e.  NN  /\  ( P  e.  ( ZZ>=
`  2 )  /\  z  ||  P ) )  ->  ( -.  (
z  =  1  \/  z  =  P )  <-> 
z  e.  ( 2 ... ( P  - 
1 ) ) ) )
5352expcom 435 . . . . . . . . . 10  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
z  e.  NN  ->  ( -.  ( z  =  1  \/  z  =  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
5453pm5.32d 639 . . . . . . . . 9  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  ( z  e.  NN  /\  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
55 fzssuz 11735 . . . . . . . . . . . . 13  |-  ( 2 ... ( P  - 
1 ) )  C_  ( ZZ>= `  2 )
56 2eluzge1 11138 . . . . . . . . . . . . . 14  |-  2  e.  ( ZZ>= `  1 )
57 uzss 11112 . . . . . . . . . . . . . 14  |-  ( 2  e.  ( ZZ>= `  1
)  ->  ( ZZ>= ` 
2 )  C_  ( ZZ>=
`  1 ) )
5856, 57ax-mp 5 . . . . . . . . . . . . 13  |-  ( ZZ>= ` 
2 )  C_  ( ZZ>=
`  1 )
5955, 58sstri 3498 . . . . . . . . . . . 12  |-  ( 2 ... ( P  - 
1 ) )  C_  ( ZZ>= `  1 )
60 nnuz 11127 . . . . . . . . . . . 12  |-  NN  =  ( ZZ>= `  1 )
6159, 60sseqtr4i 3522 . . . . . . . . . . 11  |-  ( 2 ... ( P  - 
1 ) )  C_  NN
6261sseli 3485 . . . . . . . . . 10  |-  ( z  e.  ( 2 ... ( P  -  1 ) )  ->  z  e.  NN )
6362pm4.71ri 633 . . . . . . . . 9  |-  ( z  e.  ( 2 ... ( P  -  1 ) )  <->  ( z  e.  NN  /\  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6454, 63syl6bbr 263 . . . . . . . 8  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6564notbid 294 . . . . . . 7  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  ( -.  ( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) )
662, 65syl5bb 257 . . . . . 6  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) )  <->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6766pm5.74da 687 . . . . 5  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( (
z  ||  P  ->  ( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) ) )  <->  ( z  ||  P  ->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
68 bi2.04 361 . . . . 5  |-  ( ( z  ||  P  -> 
( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) ) )  <->  ( z  e.  NN  ->  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
69 con2b 334 . . . . 5  |-  ( ( z  ||  P  ->  -.  z  e.  (
2 ... ( P  - 
1 ) ) )  <-> 
( z  e.  ( 2 ... ( P  -  1 ) )  ->  -.  z  ||  P ) )
7067, 68, 693bitr3g 287 . . . 4  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( (
z  e.  NN  ->  ( z  ||  P  -> 
( z  =  1  \/  z  =  P ) ) )  <->  ( z  e.  ( 2 ... ( P  -  1 ) )  ->  -.  z  ||  P ) ) )
7170ralbidv2 2878 . . 3  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( A. z  e.  NN  (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) )  <->  A. z  e.  ( 2 ... ( P  -  1 ) )  -.  z  ||  P
) )
7271pm5.32i 637 . 2  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  A. z  e.  NN  (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) )  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  ( 2 ... ( P  -  1 ) )  -.  z  ||  P
) )
731, 72bitri 249 1  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  ( 2 ... ( P  -  1 ) )  -.  z  ||  P
) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 184    \/ wo 368    /\ wa 369    = wceq 1383    e. wcel 1804    =/= wne 2638   A.wral 2793    C_ wss 3461   class class class wbr 4437   ` cfv 5578  (class class class)co 6281   RRcr 9494   1c1 9496    + caddc 9498    < clt 9631    <_ cle 9632    - cmin 9810   NNcn 10543   2c2 10592   ZZcz 10871   ZZ>=cuz 11092   ...cfz 11683    || cdvds 13968   Primecprime 14199
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1605  ax-4 1618  ax-5 1691  ax-6 1734  ax-7 1776  ax-8 1806  ax-9 1808  ax-10 1823  ax-11 1828  ax-12 1840  ax-13 1985  ax-ext 2421  ax-sep 4558  ax-nul 4566  ax-pow 4615  ax-pr 4676  ax-un 6577  ax-cnex 9551  ax-resscn 9552  ax-1cn 9553  ax-icn 9554  ax-addcl 9555  ax-addrcl 9556  ax-mulcl 9557  ax-mulrcl 9558  ax-mulcom 9559  ax-addass 9560  ax-mulass 9561  ax-distr 9562  ax-i2m1 9563  ax-1ne0 9564  ax-1rid 9565  ax-rnegex 9566  ax-rrecex 9567  ax-cnre 9568  ax-pre-lttri 9569  ax-pre-lttrn 9570  ax-pre-ltadd 9571  ax-pre-mulgt0 9572
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 975  df-3an 976  df-tru 1386  df-ex 1600  df-nf 1604  df-sb 1727  df-eu 2272  df-mo 2273  df-clab 2429  df-cleq 2435  df-clel 2438  df-nfc 2593  df-ne 2640  df-nel 2641  df-ral 2798  df-rex 2799  df-reu 2800  df-rab 2802  df-v 3097  df-sbc 3314  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3771  df-if 3927  df-pw 3999  df-sn 4015  df-pr 4017  df-tp 4019  df-op 4021  df-uni 4235  df-int 4272  df-iun 4317  df-br 4438  df-opab 4496  df-mpt 4497  df-tr 4531  df-eprel 4781  df-id 4785  df-po 4790  df-so 4791  df-fr 4828  df-we 4830  df-ord 4871  df-on 4872  df-lim 4873  df-suc 4874  df-xp 4995  df-rel 4996  df-cnv 4997  df-co 4998  df-dm 4999  df-rn 5000  df-res 5001  df-ima 5002  df-iota 5541  df-fun 5580  df-fn 5581  df-f 5582  df-f1 5583  df-fo 5584  df-f1o 5585  df-fv 5586  df-riota 6242  df-ov 6284  df-oprab 6285  df-mpt2 6286  df-om 6686  df-1st 6785  df-2nd 6786  df-recs 7044  df-rdg 7078  df-1o 7132  df-2o 7133  df-oadd 7136  df-er 7313  df-en 7519  df-dom 7520  df-sdom 7521  df-fin 7522  df-pnf 9633  df-mnf 9634  df-xr 9635  df-ltxr 9636  df-le 9637  df-sub 9812  df-neg 9813  df-nn 10544  df-2 10601  df-n0 10803  df-z 10872  df-uz 11093  df-fz 11684  df-dvds 13969  df-prm 14200
This theorem is referenced by:  prmind2  14210  2prm  14215  3prm  14216  wilth  23323  mersenne  23480
  Copyright terms: Public domain W3C validator