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

Theorem isprm3 14576
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 14575 . 2  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
2 iman 425 . . . . . . 7  |-  ( ( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) )  <->  -.  ( z  e.  NN  /\  -.  (
z  =  1  \/  z  =  P ) ) )
3 eluz2nn 11148 . . . . . . . . . . . . . . . 16  |-  ( P  e.  ( ZZ>= `  2
)  ->  P  e.  NN )
4 nnz 10910 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  NN  ->  z  e.  ZZ )
5 dvdsle 14293 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( z  ||  P  ->  z  <_  P )
)
64, 5sylan 473 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  ( z  ||  P  ->  z  <_  P )
)
7 nnge1 10586 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  NN  ->  1  <_  z )
87adantr 466 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  1  <_  z )
96, 8jctild 545 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  NN  /\  P  e.  NN )  ->  ( z  ||  P  ->  ( 1  <_  z  /\  z  <_  P ) ) )
103, 9sylan2 476 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( z  ||  P  ->  ( 1  <_  z  /\  z  <_  P ) ) )
11 zre 10892 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  ZZ  ->  z  e.  RR )
12 nnre 10567 . . . . . . . . . . . . . . . . . 18  |-  ( P  e.  NN  ->  P  e.  RR )
13 1re 9593 . . . . . . . . . . . . . . . . . . . . . 22  |-  1  e.  RR
14 leltne 9674 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ( 1  e.  RR  /\  z  e.  RR  /\  1  <_  z )  ->  (
1  <  z  <->  z  =/=  1 ) )
1513, 14mp3an1 1347 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ( z  e.  RR  /\  1  <_  z )  -> 
( 1  <  z  <->  z  =/=  1 ) )
16153adant2 1024 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( z  e.  RR  /\  P  e.  RR  /\  1  <_  z )  ->  (
1  <  z  <->  z  =/=  1 ) )
17163expia 1207 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( 1  <_  z  ->  ( 1  <  z  <->  z  =/=  1 ) ) )
18 leltne 9674 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( z  e.  RR  /\  P  e.  RR  /\  z  <_  P )  ->  (
z  <  P  <->  P  =/=  z ) )
19183expia 1207 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( z  <_  P  ->  ( z  <  P  <->  P  =/=  z ) ) )
2017, 19anim12d 565 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  RR  /\  P  e.  RR )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  <->  z  =/=  1 )  /\  (
z  <  P  <->  P  =/=  z ) ) ) )
2111, 12, 20syl2an 479 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  <->  z  =/=  1 )  /\  (
z  <  P  <->  P  =/=  z ) ) ) )
22 pm4.38 880 . . . . . . . . . . . . . . . . . 18  |-  ( ( ( 1  <  z  <->  z  =/=  1 )  /\  ( z  <  P  <->  P  =/=  z ) )  ->  ( ( 1  <  z  /\  z  <  P )  <->  ( z  =/=  1  /\  P  =/=  z ) ) )
23 df-ne 2601 . . . . . . . . . . . . . . . . . . . 20  |-  ( z  =/=  1  <->  -.  z  =  1 )
24 nesym 2657 . . . . . . . . . . . . . . . . . . . 20  |-  ( P  =/=  z  <->  -.  z  =  P )
2523, 24anbi12i 701 . . . . . . . . . . . . . . . . . . 19  |-  ( ( z  =/=  1  /\  P  =/=  z )  <-> 
( -.  z  =  1  /\  -.  z  =  P ) )
26 ioran 492 . . . . . . . . . . . . . . . . . . 19  |-  ( -.  ( z  =  1  \/  z  =  P )  <->  ( -.  z  =  1  /\  -.  z  =  P )
)
2725, 26bitr4i 255 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  =/=  1  /\  P  =/=  z )  <->  -.  ( z  =  1  \/  z  =  P ) )
2822, 27syl6bb 264 . . . . . . . . . . . . . . . . 17  |-  ( ( ( 1  <  z  <->  z  =/=  1 )  /\  ( z  <  P  <->  P  =/=  z ) )  ->  ( ( 1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) )
2921, 28syl6 34 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  NN )  ->  ( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) ) )
304, 3, 29syl2an 479 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( ( 1  <_ 
z  /\  z  <_  P )  ->  ( (
1  <  z  /\  z  <  P )  <->  -.  (
z  =  1  \/  z  =  P ) ) ) )
3110, 30syld 45 . . . . . . . . . . . . . 14  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( z  ||  P  ->  ( ( 1  < 
z  /\  z  <  P )  <->  -.  ( z  =  1  \/  z  =  P ) ) ) )
3231imp 430 . . . . . . . . . . . . 13  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  -.  ( z  =  1  \/  z  =  P ) ) )
33 eluzelz 11119 . . . . . . . . . . . . . . 15  |-  ( P  e.  ( ZZ>= `  2
)  ->  P  e.  ZZ )
34 1z 10918 . . . . . . . . . . . . . . . . . . . 20  |-  1  e.  ZZ
35 zltp1le 10937 . . . . . . . . . . . . . . . . . . . 20  |-  ( ( 1  e.  ZZ  /\  z  e.  ZZ )  ->  ( 1  <  z  <->  ( 1  +  1 )  <_  z ) )
3634, 35mpan 674 . . . . . . . . . . . . . . . . . . 19  |-  ( z  e.  ZZ  ->  (
1  <  z  <->  ( 1  +  1 )  <_ 
z ) )
37 df-2 10619 . . . . . . . . . . . . . . . . . . . 20  |-  2  =  ( 1  +  1 )
3837breq1i 4373 . . . . . . . . . . . . . . . . . . 19  |-  ( 2  <_  z  <->  ( 1  +  1 )  <_ 
z )
3936, 38syl6bbr 266 . . . . . . . . . . . . . . . . . 18  |-  ( z  e.  ZZ  ->  (
1  <  z  <->  2  <_  z ) )
4039adantr 466 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( 1  <  z  <->  2  <_  z ) )
41 zltlem1 10940 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( z  <  P  <->  z  <_  ( P  - 
1 ) ) )
4240, 41anbi12d 715 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( 1  < 
z  /\  z  <  P )  <->  ( 2  <_ 
z  /\  z  <_  ( P  -  1 ) ) ) )
43 peano2zm 10931 . . . . . . . . . . . . . . . . 17  |-  ( P  e.  ZZ  ->  ( P  -  1 )  e.  ZZ )
44 2z 10920 . . . . . . . . . . . . . . . . . 18  |-  2  e.  ZZ
45 elfz 11741 . . . . . . . . . . . . . . . . . 18  |-  ( ( z  e.  ZZ  /\  2  e.  ZZ  /\  ( P  -  1 )  e.  ZZ )  -> 
( z  e.  ( 2 ... ( P  -  1 ) )  <-> 
( 2  <_  z  /\  z  <_  ( P  -  1 ) ) ) )
4644, 45mp3an2 1348 . . . . . . . . . . . . . . . . 17  |-  ( ( z  e.  ZZ  /\  ( P  -  1
)  e.  ZZ )  ->  ( z  e.  ( 2 ... ( P  -  1 ) )  <->  ( 2  <_ 
z  /\  z  <_  ( P  -  1 ) ) ) )
4743, 46sylan2 476 . . . . . . . . . . . . . . . 16  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( z  e.  ( 2 ... ( P  -  1 ) )  <-> 
( 2  <_  z  /\  z  <_  ( P  -  1 ) ) ) )
4842, 47bitr4d 259 . . . . . . . . . . . . . . 15  |-  ( ( z  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
494, 33, 48syl2an 479 . . . . . . . . . . . . . 14  |-  ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5049adantr 466 . . . . . . . . . . . . 13  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( ( 1  < 
z  /\  z  <  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5132, 50bitr3d 258 . . . . . . . . . . . 12  |-  ( ( ( z  e.  NN  /\  P  e.  ( ZZ>= ` 
2 ) )  /\  z  ||  P )  -> 
( -.  ( z  =  1  \/  z  =  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
5251anasss 651 . . . . . . . . . . 11  |-  ( ( z  e.  NN  /\  ( P  e.  ( ZZ>=
`  2 )  /\  z  ||  P ) )  ->  ( -.  (
z  =  1  \/  z  =  P )  <-> 
z  e.  ( 2 ... ( P  - 
1 ) ) ) )
5352expcom 436 . . . . . . . . . 10  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
z  e.  NN  ->  ( -.  ( z  =  1  \/  z  =  P )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
5453pm5.32d 643 . . . . . . . . 9  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  ( z  e.  NN  /\  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
55 fzssuz 11790 . . . . . . . . . . . . 13  |-  ( 2 ... ( P  - 
1 ) )  C_  ( ZZ>= `  2 )
56 2eluzge1 11156 . . . . . . . . . . . . . 14  |-  2  e.  ( ZZ>= `  1 )
57 uzss 11130 . . . . . . . . . . . . . 14  |-  ( 2  e.  ( ZZ>= `  1
)  ->  ( ZZ>= ` 
2 )  C_  ( ZZ>=
`  1 ) )
5856, 57ax-mp 5 . . . . . . . . . . . . 13  |-  ( ZZ>= ` 
2 )  C_  ( ZZ>=
`  1 )
5955, 58sstri 3416 . . . . . . . . . . . 12  |-  ( 2 ... ( P  - 
1 ) )  C_  ( ZZ>= `  1 )
60 nnuz 11145 . . . . . . . . . . . 12  |-  NN  =  ( ZZ>= `  1 )
6159, 60sseqtr4i 3440 . . . . . . . . . . 11  |-  ( 2 ... ( P  - 
1 ) )  C_  NN
6261sseli 3403 . . . . . . . . . 10  |-  ( z  e.  ( 2 ... ( P  -  1 ) )  ->  z  e.  NN )
6362pm4.71ri 637 . . . . . . . . 9  |-  ( z  e.  ( 2 ... ( P  -  1 ) )  <->  ( z  e.  NN  /\  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6454, 63syl6bbr 266 . . . . . . . 8  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6564notbid 295 . . . . . . 7  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  ( -.  ( z  e.  NN  /\ 
-.  ( z  =  1  \/  z  =  P ) )  <->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) )
662, 65syl5bb 260 . . . . . 6  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  z  ||  P )  ->  (
( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) )  <->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) )
6766pm5.74da 691 . . . . 5  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( (
z  ||  P  ->  ( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) ) )  <->  ( z  ||  P  ->  -.  z  e.  ( 2 ... ( P  -  1 ) ) ) ) )
68 bi2.04 362 . . . . 5  |-  ( ( z  ||  P  -> 
( z  e.  NN  ->  ( z  =  1  \/  z  =  P ) ) )  <->  ( z  e.  NN  ->  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
69 con2b 335 . . . . 5  |-  ( ( z  ||  P  ->  -.  z  e.  (
2 ... ( P  - 
1 ) ) )  <-> 
( z  e.  ( 2 ... ( P  -  1 ) )  ->  -.  z  ||  P ) )
7067, 68, 693bitr3g 290 . . . 4  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( (
z  e.  NN  ->  ( z  ||  P  -> 
( z  =  1  \/  z  =  P ) ) )  <->  ( z  e.  ( 2 ... ( P  -  1 ) )  ->  -.  z  ||  P ) ) )
7170ralbidv2 2800 . . 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 641 . 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 252 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 187    \/ wo 369    /\ wa 370    = wceq 1437    e. wcel 1872    =/= wne 2599   A.wral 2714    C_ wss 3379   class class class wbr 4366   ` cfv 5544  (class class class)co 6249   RRcr 9489   1c1 9491    + caddc 9493    < clt 9626    <_ cle 9627    - cmin 9811   NNcn 10560   2c2 10610   ZZcz 10888   ZZ>=cuz 11110   ...cfz 11735    || cdvds 14248   Primecprime 14565
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1663  ax-4 1676  ax-5 1752  ax-6 1798  ax-7 1843  ax-8 1874  ax-9 1876  ax-10 1891  ax-11 1896  ax-12 1909  ax-13 2063  ax-ext 2408  ax-sep 4489  ax-nul 4498  ax-pow 4545  ax-pr 4603  ax-un 6541  ax-cnex 9546  ax-resscn 9547  ax-1cn 9548  ax-icn 9549  ax-addcl 9550  ax-addrcl 9551  ax-mulcl 9552  ax-mulrcl 9553  ax-mulcom 9554  ax-addass 9555  ax-mulass 9556  ax-distr 9557  ax-i2m1 9558  ax-1ne0 9559  ax-1rid 9560  ax-rnegex 9561  ax-rrecex 9562  ax-cnre 9563  ax-pre-lttri 9564  ax-pre-lttrn 9565  ax-pre-ltadd 9566  ax-pre-mulgt0 9567
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-tru 1440  df-ex 1658  df-nf 1662  df-sb 1791  df-eu 2280  df-mo 2281  df-clab 2415  df-cleq 2421  df-clel 2424  df-nfc 2558  df-ne 2601  df-nel 2602  df-ral 2719  df-rex 2720  df-reu 2721  df-rab 2723  df-v 3024  df-sbc 3243  df-csb 3339  df-dif 3382  df-un 3384  df-in 3386  df-ss 3393  df-pss 3395  df-nul 3705  df-if 3855  df-pw 3926  df-sn 3942  df-pr 3944  df-tp 3946  df-op 3948  df-uni 4163  df-int 4199  df-iun 4244  df-br 4367  df-opab 4426  df-mpt 4427  df-tr 4462  df-eprel 4707  df-id 4711  df-po 4717  df-so 4718  df-fr 4755  df-we 4757  df-xp 4802  df-rel 4803  df-cnv 4804  df-co 4805  df-dm 4806  df-rn 4807  df-res 4808  df-ima 4809  df-pred 5342  df-ord 5388  df-on 5389  df-lim 5390  df-suc 5391  df-iota 5508  df-fun 5546  df-fn 5547  df-f 5548  df-f1 5549  df-fo 5550  df-f1o 5551  df-fv 5552  df-riota 6211  df-ov 6252  df-oprab 6253  df-mpt2 6254  df-om 6651  df-1st 6751  df-2nd 6752  df-wrecs 6983  df-recs 7045  df-rdg 7083  df-1o 7137  df-2o 7138  df-oadd 7141  df-er 7318  df-en 7525  df-dom 7526  df-sdom 7527  df-fin 7528  df-pnf 9628  df-mnf 9629  df-xr 9630  df-ltxr 9631  df-le 9632  df-sub 9813  df-neg 9814  df-nn 10561  df-2 10619  df-n0 10821  df-z 10889  df-uz 11111  df-fz 11736  df-dvds 14249  df-prm 14566
This theorem is referenced by:  prmind2  14578  2prm  14583  3prm  14584  ncoprmlnprm  14620  wilth  23938  mersenne  24097
  Copyright terms: Public domain W3C validator