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

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

Proof of Theorem isprm2
Dummy variable  n is distinct from all other variables.
StepHypRef Expression
1 1nprm 14629 . . . . 5  |-  -.  1  e.  Prime
2 eleq1 2495 . . . . . 6  |-  ( P  =  1  ->  ( P  e.  Prime  <->  1  e.  Prime ) )
32biimpcd 227 . . . . 5  |-  ( P  e.  Prime  ->  ( P  =  1  ->  1  e.  Prime ) )
41, 3mtoi 181 . . . 4  |-  ( P  e.  Prime  ->  -.  P  =  1 )
54neqned 2623 . . 3  |-  ( P  e.  Prime  ->  P  =/=  1 )
65pm4.71i 636 . 2  |-  ( P  e.  Prime  <->  ( P  e. 
Prime  /\  P  =/=  1
) )
7 isprm 14624 . . . 4  |-  ( P  e.  Prime  <->  ( P  e.  NN  /\  { n  e.  NN  |  n  ||  P }  ~~  2o ) )
8 isprm2lem 14631 . . . . . . 7  |-  ( ( P  e.  NN  /\  P  =/=  1 )  -> 
( { n  e.  NN  |  n  ||  P }  ~~  2o  <->  { n  e.  NN  |  n  ||  P }  =  {
1 ,  P }
) )
9 eqss 3479 . . . . . . . . . . 11  |-  ( { n  e.  NN  |  n  ||  P }  =  { 1 ,  P } 
<->  ( { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }  /\  { 1 ,  P }  C_ 
{ n  e.  NN  |  n  ||  P }
) )
109imbi2i 313 . . . . . . . . . 10  |-  ( ( P  e.  NN  ->  { n  e.  NN  |  n  ||  P }  =  { 1 ,  P } )  <->  ( P  e.  NN  ->  ( {
n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }  /\  { 1 ,  P }  C_  { n  e.  NN  |  n  ||  P } ) ) )
11 1idssfct 14630 . . . . . . . . . . 11  |-  ( P  e.  NN  ->  { 1 ,  P }  C_  { n  e.  NN  |  n  ||  P } )
12 jcab 871 . . . . . . . . . . 11  |-  ( ( P  e.  NN  ->  ( { n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P }  /\  { 1 ,  P }  C_  { n  e.  NN  |  n  ||  P } ) )  <->  ( ( P  e.  NN  ->  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
)  /\  ( P  e.  NN  ->  { 1 ,  P }  C_  { n  e.  NN  |  n  ||  P } ) ) )
1311, 12mpbiran2 927 . . . . . . . . . 10  |-  ( ( P  e.  NN  ->  ( { n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P }  /\  { 1 ,  P }  C_  { n  e.  NN  |  n  ||  P } ) )  <->  ( P  e.  NN  ->  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } ) )
1410, 13bitri 252 . . . . . . . . 9  |-  ( ( P  e.  NN  ->  { n  e.  NN  |  n  ||  P }  =  { 1 ,  P } )  <->  ( P  e.  NN  ->  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } ) )
1514pm5.74ri 249 . . . . . . . 8  |-  ( P  e.  NN  ->  ( { n  e.  NN  |  n  ||  P }  =  { 1 ,  P } 
<->  { n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } ) )
1615adantr 466 . . . . . . 7  |-  ( ( P  e.  NN  /\  P  =/=  1 )  -> 
( { n  e.  NN  |  n  ||  P }  =  {
1 ,  P }  <->  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
) )
178, 16bitrd 256 . . . . . 6  |-  ( ( P  e.  NN  /\  P  =/=  1 )  -> 
( { n  e.  NN  |  n  ||  P }  ~~  2o  <->  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } ) )
1817expcom 436 . . . . 5  |-  ( P  =/=  1  ->  ( P  e.  NN  ->  ( { n  e.  NN  |  n  ||  P }  ~~  2o  <->  { n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } ) ) )
1918pm5.32d 643 . . . 4  |-  ( P  =/=  1  ->  (
( P  e.  NN  /\ 
{ n  e.  NN  |  n  ||  P }  ~~  2o )  <->  ( P  e.  NN  /\  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } ) ) )
207, 19syl5bb 260 . . 3  |-  ( P  =/=  1  ->  ( P  e.  Prime  <->  ( P  e.  NN  /\  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } ) ) )
2120pm5.32ri 642 . 2  |-  ( ( P  e.  Prime  /\  P  =/=  1 )  <->  ( ( P  e.  NN  /\  {
n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
)  /\  P  =/=  1 ) )
22 ancom 451 . . . 4  |-  ( ( ( P  e.  NN  /\ 
{ n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } )  /\  P  =/=  1 )  <->  ( P  =/=  1  /\  ( P  e.  NN  /\  {
n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
) ) )
23 anass 653 . . . 4  |-  ( ( ( P  =/=  1  /\  P  e.  NN )  /\  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } )  <-> 
( P  =/=  1  /\  ( P  e.  NN  /\ 
{ n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } ) ) )
2422, 23bitr4i 255 . . 3  |-  ( ( ( P  e.  NN  /\ 
{ n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } )  /\  P  =/=  1 )  <->  ( ( P  =/=  1  /\  P  e.  NN )  /\  {
n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
) )
25 ancom 451 . . . . 5  |-  ( ( P  =/=  1  /\  P  e.  NN )  <-> 
( P  e.  NN  /\  P  =/=  1 ) )
26 eluz2b3 11240 . . . . 5  |-  ( P  e.  ( ZZ>= `  2
)  <->  ( P  e.  NN  /\  P  =/=  1 ) )
2725, 26bitr4i 255 . . . 4  |-  ( ( P  =/=  1  /\  P  e.  NN )  <-> 
P  e.  ( ZZ>= ` 
2 ) )
2827anbi1i 699 . . 3  |-  ( ( ( P  =/=  1  /\  P  e.  NN )  /\  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P } )  <-> 
( P  e.  (
ZZ>= `  2 )  /\  { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
) )
29 dfss2 3453 . . . . 5  |-  ( { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }  <->  A. z ( z  e. 
{ n  e.  NN  |  n  ||  P }  ->  z  e.  { 1 ,  P } ) )
30 breq1 4426 . . . . . . . . . 10  |-  ( n  =  z  ->  (
n  ||  P  <->  z  ||  P ) )
3130elrab 3228 . . . . . . . . 9  |-  ( z  e.  { n  e.  NN  |  n  ||  P }  <->  ( z  e.  NN  /\  z  ||  P ) )
32 vex 3083 . . . . . . . . . 10  |-  z  e. 
_V
3332elpr 4016 . . . . . . . . 9  |-  ( z  e.  { 1 ,  P }  <->  ( z  =  1  \/  z  =  P ) )
3431, 33imbi12i 327 . . . . . . . 8  |-  ( ( z  e.  { n  e.  NN  |  n  ||  P }  ->  z  e. 
{ 1 ,  P } )  <->  ( (
z  e.  NN  /\  z  ||  P )  -> 
( z  =  1  \/  z  =  P ) ) )
35 impexp 447 . . . . . . . 8  |-  ( ( ( z  e.  NN  /\  z  ||  P )  ->  ( z  =  1  \/  z  =  P ) )  <->  ( z  e.  NN  ->  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
3634, 35bitri 252 . . . . . . 7  |-  ( ( z  e.  { n  e.  NN  |  n  ||  P }  ->  z  e. 
{ 1 ,  P } )  <->  ( z  e.  NN  ->  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
3736albii 1685 . . . . . 6  |-  ( A. z ( z  e. 
{ n  e.  NN  |  n  ||  P }  ->  z  e.  { 1 ,  P } )  <->  A. z ( z  e.  NN  ->  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
38 df-ral 2776 . . . . . 6  |-  ( A. z  e.  NN  (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) )  <->  A. z ( z  e.  NN  ->  (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
3937, 38bitr4i 255 . . . . 5  |-  ( A. z ( z  e. 
{ n  e.  NN  |  n  ||  P }  ->  z  e.  { 1 ,  P } )  <->  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) )
4029, 39bitri 252 . . . 4  |-  ( { n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }  <->  A. z  e.  NN  (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) )
4140anbi2i 698 . . 3  |-  ( ( P  e.  ( ZZ>= ` 
2 )  /\  {
n  e.  NN  |  n  ||  P }  C_  { 1 ,  P }
)  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
4224, 28, 413bitri 274 . 2  |-  ( ( ( P  e.  NN  /\ 
{ n  e.  NN  |  n  ||  P }  C_ 
{ 1 ,  P } )  /\  P  =/=  1 )  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
436, 21, 423bitri 274 1  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 187    \/ wo 369    /\ wa 370   A.wal 1435    = wceq 1437    e. wcel 1872    =/= wne 2614   A.wral 2771   {crab 2775    C_ wss 3436   {cpr 4000   class class class wbr 4423   ` cfv 5601   2oc2o 7188    ~~ cen 7578   1c1 9548   NNcn 10617   2c2 10667   ZZ>=cuz 11167    || cdvds 14305   Primecprime 14622
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 2057  ax-ext 2401  ax-sep 4546  ax-nul 4555  ax-pow 4602  ax-pr 4660  ax-un 6598  ax-cnex 9603  ax-resscn 9604  ax-1cn 9605  ax-icn 9606  ax-addcl 9607  ax-addrcl 9608  ax-mulcl 9609  ax-mulrcl 9610  ax-mulcom 9611  ax-addass 9612  ax-mulass 9613  ax-distr 9614  ax-i2m1 9615  ax-1ne0 9616  ax-1rid 9617  ax-rnegex 9618  ax-rrecex 9619  ax-cnre 9620  ax-pre-lttri 9621  ax-pre-lttrn 9622  ax-pre-ltadd 9623  ax-pre-mulgt0 9624
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 2273  df-mo 2274  df-clab 2408  df-cleq 2414  df-clel 2417  df-nfc 2568  df-ne 2616  df-nel 2617  df-ral 2776  df-rex 2777  df-reu 2778  df-rab 2780  df-v 3082  df-sbc 3300  df-csb 3396  df-dif 3439  df-un 3441  df-in 3443  df-ss 3450  df-pss 3452  df-nul 3762  df-if 3912  df-pw 3983  df-sn 3999  df-pr 4001  df-tp 4003  df-op 4005  df-uni 4220  df-int 4256  df-iun 4301  df-br 4424  df-opab 4483  df-mpt 4484  df-tr 4519  df-eprel 4764  df-id 4768  df-po 4774  df-so 4775  df-fr 4812  df-we 4814  df-xp 4859  df-rel 4860  df-cnv 4861  df-co 4862  df-dm 4863  df-rn 4864  df-res 4865  df-ima 4866  df-pred 5399  df-ord 5445  df-on 5446  df-lim 5447  df-suc 5448  df-iota 5565  df-fun 5603  df-fn 5604  df-f 5605  df-f1 5606  df-fo 5607  df-f1o 5608  df-fv 5609  df-riota 6268  df-ov 6309  df-oprab 6310  df-mpt2 6311  df-om 6708  df-wrecs 7040  df-recs 7102  df-rdg 7140  df-1o 7194  df-2o 7195  df-oadd 7198  df-er 7375  df-en 7582  df-dom 7583  df-sdom 7584  df-fin 7585  df-pnf 9685  df-mnf 9686  df-xr 9687  df-ltxr 9688  df-le 9689  df-sub 9870  df-neg 9871  df-nn 10618  df-2 10676  df-n0 10878  df-z 10946  df-uz 11168  df-dvds 14306  df-prm 14623
This theorem is referenced by:  isprm3  14633  isprm4  14634  dvdsprime  14637  coprm  14657  isprm6  14666  prmirredlem  19063  znidomb  19131  perfectlem2  24157  perfectALTVlem2  38715
  Copyright terms: Public domain W3C validator