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

Theorem coprm 13027
Description: A prime number either divides an integer or is coprime to it, but not both. (Contributed by Paul Chapman, 22-Jun-2011.)
Assertion
Ref Expression
coprm  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  P  ||  N  <->  ( P  gcd  N )  =  1 ) )

Proof of Theorem coprm
Dummy variable  z is distinct from all other variables.
StepHypRef Expression
1 prmz 13010 . . . . . . 7  |-  ( P  e.  Prime  ->  P  e.  ZZ )
2 gcddvds 12942 . . . . . . 7  |-  ( ( P  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( P  gcd  N )  ||  P  /\  ( P  gcd  N ) 
||  N ) )
31, 2sylan 458 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  gcd  N
)  ||  P  /\  ( P  gcd  N ) 
||  N ) )
43simprd 450 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  gcd  N )  ||  N )
5 breq1 4156 . . . . 5  |-  ( ( P  gcd  N )  =  P  ->  (
( P  gcd  N
)  ||  N  <->  P  ||  N
) )
64, 5syl5ibcom 212 . . . 4  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  gcd  N
)  =  P  ->  P  ||  N ) )
76con3d 127 . . 3  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  P  ||  N  ->  -.  ( P  gcd  N
)  =  P ) )
8 0nnn 9963 . . . . . . . . 9  |-  -.  0  e.  NN
9 prmnn 13009 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  NN )
10 eleq1 2447 . . . . . . . . . 10  |-  ( P  =  0  ->  ( P  e.  NN  <->  0  e.  NN ) )
119, 10syl5ibcom 212 . . . . . . . . 9  |-  ( P  e.  Prime  ->  ( P  =  0  ->  0  e.  NN ) )
128, 11mtoi 171 . . . . . . . 8  |-  ( P  e.  Prime  ->  -.  P  =  0 )
1312intnanrd 884 . . . . . . 7  |-  ( P  e.  Prime  ->  -.  ( P  =  0  /\  N  =  0 ) )
1413adantr 452 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  -.  ( P  =  0  /\  N  =  0
) )
15 gcdn0cl 12941 . . . . . . . 8  |-  ( ( ( P  e.  ZZ  /\  N  e.  ZZ )  /\  -.  ( P  =  0  /\  N  =  0 ) )  ->  ( P  gcd  N )  e.  NN )
1615ex 424 . . . . . . 7  |-  ( ( P  e.  ZZ  /\  N  e.  ZZ )  ->  ( -.  ( P  =  0  /\  N  =  0 )  -> 
( P  gcd  N
)  e.  NN ) )
171, 16sylan 458 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  ( P  =  0  /\  N  =  0 )  ->  ( P  gcd  N )  e.  NN ) )
1814, 17mpd 15 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  gcd  N )  e.  NN )
193simpld 446 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  gcd  N )  ||  P )
20 isprm2 13014 . . . . . . . 8  |-  ( P  e.  Prime  <->  ( P  e.  ( ZZ>= `  2 )  /\  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) ) )
2120simprbi 451 . . . . . . 7  |-  ( P  e.  Prime  ->  A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) ) )
22 breq1 4156 . . . . . . . . 9  |-  ( z  =  ( P  gcd  N )  ->  ( z  ||  P  <->  ( P  gcd  N )  ||  P ) )
23 eqeq1 2393 . . . . . . . . . 10  |-  ( z  =  ( P  gcd  N )  ->  ( z  =  1  <->  ( P  gcd  N )  =  1 ) )
24 eqeq1 2393 . . . . . . . . . 10  |-  ( z  =  ( P  gcd  N )  ->  ( z  =  P  <->  ( P  gcd  N )  =  P ) )
2523, 24orbi12d 691 . . . . . . . . 9  |-  ( z  =  ( P  gcd  N )  ->  ( (
z  =  1  \/  z  =  P )  <-> 
( ( P  gcd  N )  =  1  \/  ( P  gcd  N
)  =  P ) ) )
2622, 25imbi12d 312 . . . . . . . 8  |-  ( z  =  ( P  gcd  N )  ->  ( (
z  ||  P  ->  ( z  =  1  \/  z  =  P ) )  <->  ( ( P  gcd  N )  ||  P  ->  ( ( P  gcd  N )  =  1  \/  ( P  gcd  N )  =  P ) ) ) )
2726rspcv 2991 . . . . . . 7  |-  ( ( P  gcd  N )  e.  NN  ->  ( A. z  e.  NN  ( z  ||  P  ->  ( z  =  1  \/  z  =  P ) )  ->  (
( P  gcd  N
)  ||  P  ->  ( ( P  gcd  N
)  =  1  \/  ( P  gcd  N
)  =  P ) ) ) )
2821, 27syl5com 28 . . . . . 6  |-  ( P  e.  Prime  ->  ( ( P  gcd  N )  e.  NN  ->  (
( P  gcd  N
)  ||  P  ->  ( ( P  gcd  N
)  =  1  \/  ( P  gcd  N
)  =  P ) ) ) )
2928adantr 452 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  gcd  N
)  e.  NN  ->  ( ( P  gcd  N
)  ||  P  ->  ( ( P  gcd  N
)  =  1  \/  ( P  gcd  N
)  =  P ) ) ) )
3018, 19, 29mp2d 43 . . . 4  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  gcd  N
)  =  1  \/  ( P  gcd  N
)  =  P ) )
31 biorf 395 . . . . 5  |-  ( -.  ( P  gcd  N
)  =  P  -> 
( ( P  gcd  N )  =  1  <->  (
( P  gcd  N
)  =  P  \/  ( P  gcd  N )  =  1 ) ) )
32 orcom 377 . . . . 5  |-  ( ( ( P  gcd  N
)  =  P  \/  ( P  gcd  N )  =  1 )  <->  ( ( P  gcd  N )  =  1  \/  ( P  gcd  N )  =  P ) )
3331, 32syl6bb 253 . . . 4  |-  ( -.  ( P  gcd  N
)  =  P  -> 
( ( P  gcd  N )  =  1  <->  (
( P  gcd  N
)  =  1  \/  ( P  gcd  N
)  =  P ) ) )
3430, 33syl5ibrcom 214 . . 3  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  ( P  gcd  N
)  =  P  -> 
( P  gcd  N
)  =  1 ) )
357, 34syld 42 . 2  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  P  ||  N  -> 
( P  gcd  N
)  =  1 ) )
36 iddvds 12790 . . . . . . 7  |-  ( P  e.  ZZ  ->  P  ||  P )
371, 36syl 16 . . . . . 6  |-  ( P  e.  Prime  ->  P  ||  P )
3837adantr 452 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  P  ||  P )
39 dvdslegcd 12943 . . . . . . . . 9  |-  ( ( ( P  e.  ZZ  /\  P  e.  ZZ  /\  N  e.  ZZ )  /\  -.  ( P  =  0  /\  N  =  0 ) )  -> 
( ( P  ||  P  /\  P  ||  N
)  ->  P  <_  ( P  gcd  N ) ) )
4039ex 424 . . . . . . . 8  |-  ( ( P  e.  ZZ  /\  P  e.  ZZ  /\  N  e.  ZZ )  ->  ( -.  ( P  =  0  /\  N  =  0 )  ->  ( ( P  ||  P  /\  P  ||  N )  ->  P  <_  ( P  gcd  N
) ) ) )
41403anidm12 1241 . . . . . . 7  |-  ( ( P  e.  ZZ  /\  N  e.  ZZ )  ->  ( -.  ( P  =  0  /\  N  =  0 )  -> 
( ( P  ||  P  /\  P  ||  N
)  ->  P  <_  ( P  gcd  N ) ) ) )
421, 41sylan 458 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  ( P  =  0  /\  N  =  0 )  ->  ( ( P  ||  P  /\  P  ||  N )  ->  P  <_  ( P  gcd  N
) ) ) )
4314, 42mpd 15 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  ||  P  /\  P  ||  N )  ->  P  <_  ( P  gcd  N ) ) )
4438, 43mpand 657 . . . 4  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  ||  N  ->  P  <_  ( P  gcd  N
) ) )
45 prmuz2 13024 . . . . . . . 8  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
46 eluz2b1 10479 . . . . . . . 8  |-  ( P  e.  ( ZZ>= `  2
)  <->  ( P  e.  ZZ  /\  1  < 
P ) )
4745, 46sylib 189 . . . . . . 7  |-  ( P  e.  Prime  ->  ( P  e.  ZZ  /\  1  <  P ) )
4847simprd 450 . . . . . 6  |-  ( P  e.  Prime  ->  1  < 
P )
4948adantr 452 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  1  <  P )
501zred 10307 . . . . . . 7  |-  ( P  e.  Prime  ->  P  e.  RR )
5150adantr 452 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  P  e.  RR )
5218nnred 9947 . . . . . 6  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  gcd  N )  e.  RR )
53 1re 9023 . . . . . . 7  |-  1  e.  RR
54 ltletr 9099 . . . . . . 7  |-  ( ( 1  e.  RR  /\  P  e.  RR  /\  ( P  gcd  N )  e.  RR )  ->  (
( 1  <  P  /\  P  <_  ( P  gcd  N ) )  ->  1  <  ( P  gcd  N ) ) )
5553, 54mp3an1 1266 . . . . . 6  |-  ( ( P  e.  RR  /\  ( P  gcd  N )  e.  RR )  -> 
( ( 1  < 
P  /\  P  <_  ( P  gcd  N ) )  ->  1  <  ( P  gcd  N ) ) )
5651, 52, 55syl2anc 643 . . . . 5  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( 1  <  P  /\  P  <_  ( P  gcd  N ) )  ->  1  <  ( P  gcd  N ) ) )
5749, 56mpand 657 . . . 4  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  <_  ( P  gcd  N )  ->  1  <  ( P  gcd  N ) ) )
58 ltneOLD 9104 . . . . . 6  |-  ( ( 1  e.  RR  /\  ( P  gcd  N )  e.  RR  /\  1  <  ( P  gcd  N
) )  ->  ( P  gcd  N )  =/=  1 )
59583expia 1155 . . . . 5  |-  ( ( 1  e.  RR  /\  ( P  gcd  N )  e.  RR )  -> 
( 1  <  ( P  gcd  N )  -> 
( P  gcd  N
)  =/=  1 ) )
6053, 52, 59sylancr 645 . . . 4  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
1  <  ( P  gcd  N )  ->  ( P  gcd  N )  =/=  1 ) )
6144, 57, 603syld 53 . . 3  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( P  ||  N  ->  ( P  gcd  N )  =/=  1 ) )
6261necon2bd 2599 . 2  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  (
( P  gcd  N
)  =  1  ->  -.  P  ||  N ) )
6335, 62impbid 184 1  |-  ( ( P  e.  Prime  /\  N  e.  ZZ )  ->  ( -.  P  ||  N  <->  ( P  gcd  N )  =  1 ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 177    \/ wo 358    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1717    =/= wne 2550   A.wral 2649   class class class wbr 4153   ` cfv 5394  (class class class)co 6020   RRcr 8922   0cc0 8923   1c1 8924    < clt 9053    <_ cle 9054   NNcn 9932   2c2 9981   ZZcz 10214   ZZ>=cuz 10420    || cdivides 12779    gcd cgcd 12933   Primecprime 13006
This theorem is referenced by:  prmrp  13028  euclemma  13035  phiprmpw  13092  fermltl  13100  prmdiv  13101  prmdiveq  13102  prmpwdvds  13199  1259lem5  13381  2503lem3  13385  4001lem4  13390  gexexlem  15394  ablfac1lem  15553  ablfac1eu  15558  pgpfac1lem3  15562  perfect1  20879  perfectlem1  20880  perfectlem2  20881  lgslem1  20947  lgsqrlem2  20993  lgsqr  20997  lgsquad2lem2  21010  2sqblem  21028  rpvmasumlem  21048  dchrisum0flblem2  21070  nn0prpwlem  26016
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2368  ax-sep 4271  ax-nul 4279  ax-pow 4318  ax-pr 4344  ax-un 4641  ax-cnex 8979  ax-resscn 8980  ax-1cn 8981  ax-icn 8982  ax-addcl 8983  ax-addrcl 8984  ax-mulcl 8985  ax-mulrcl 8986  ax-mulcom 8987  ax-addass 8988  ax-mulass 8989  ax-distr 8990  ax-i2m1 8991  ax-1ne0 8992  ax-1rid 8993  ax-rnegex 8994  ax-rrecex 8995  ax-cnre 8996  ax-pre-lttri 8997  ax-pre-lttrn 8998  ax-pre-ltadd 8999  ax-pre-mulgt0 9000  ax-pre-sup 9001
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2242  df-mo 2243  df-clab 2374  df-cleq 2380  df-clel 2383  df-nfc 2512  df-ne 2552  df-nel 2553  df-ral 2654  df-rex 2655  df-reu 2656  df-rmo 2657  df-rab 2658  df-v 2901  df-sbc 3105  df-csb 3195  df-dif 3266  df-un 3268  df-in 3270  df-ss 3277  df-pss 3279  df-nul 3572  df-if 3683  df-pw 3744  df-sn 3763  df-pr 3764  df-tp 3765  df-op 3766  df-uni 3958  df-int 3993  df-iun 4037  df-br 4154  df-opab 4208  df-mpt 4209  df-tr 4244  df-eprel 4435  df-id 4439  df-po 4444  df-so 4445  df-fr 4482  df-we 4484  df-ord 4525  df-on 4526  df-lim 4527  df-suc 4528  df-om 4786  df-xp 4824  df-rel 4825  df-cnv 4826  df-co 4827  df-dm 4828  df-rn 4829  df-res 4830  df-ima 4831  df-iota 5358  df-fun 5396  df-fn 5397  df-f 5398  df-f1 5399  df-fo 5400  df-f1o 5401  df-fv 5402  df-ov 6023  df-oprab 6024  df-mpt2 6025  df-2nd 6289  df-riota 6485  df-recs 6569  df-rdg 6604  df-1o 6660  df-2o 6661  df-oadd 6664  df-er 6841  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-pnf 9055  df-mnf 9056  df-xr 9057  df-ltxr 9058  df-le 9059  df-sub 9225  df-neg 9226  df-div 9610  df-nn 9933  df-2 9990  df-3 9991  df-n0 10154  df-z 10215  df-uz 10421  df-rp 10545  df-seq 11251  df-exp 11310  df-cj 11831  df-re 11832  df-im 11833  df-sqr 11967  df-abs 11968  df-dvds 12780  df-gcd 12934  df-prm 13007
  Copyright terms: Public domain W3C validator