Metamath Proof Explorer


Theorem coprm

Description: A prime number either divides an integer or is coprime to it, but not both. Theorem 1.8 in ApostolNT p. 17. (Contributed by Paul Chapman, 22-Jun-2011)

Ref Expression
Assertion coprm P N ¬ P N P gcd N = 1

Proof

Step Hyp Ref Expression
1 prmz P P
2 gcddvds P N P gcd N P P gcd N N
3 1 2 sylan P N P gcd N P P gcd N N
4 3 simprd P N P gcd N N
5 breq1 P gcd N = P P gcd N N P N
6 4 5 syl5ibcom P N P gcd N = P P N
7 6 con3d P N ¬ P N ¬ P gcd N = P
8 0nnn ¬ 0
9 prmnn P P
10 eleq1 P = 0 P 0
11 9 10 syl5ibcom P P = 0 0
12 8 11 mtoi P ¬ P = 0
13 12 intnanrd P ¬ P = 0 N = 0
14 13 adantr P N ¬ P = 0 N = 0
15 gcdn0cl P N ¬ P = 0 N = 0 P gcd N
16 15 ex P N ¬ P = 0 N = 0 P gcd N
17 1 16 sylan P N ¬ P = 0 N = 0 P gcd N
18 14 17 mpd P N P gcd N
19 3 simpld P N P gcd N P
20 isprm2 P P 2 z z P z = 1 z = P
21 20 simprbi P z z P z = 1 z = P
22 breq1 z = P gcd N z P P gcd N P
23 eqeq1 z = P gcd N z = 1 P gcd N = 1
24 eqeq1 z = P gcd N z = P P gcd N = P
25 23 24 orbi12d z = P gcd N z = 1 z = P P gcd N = 1 P gcd N = P
26 22 25 imbi12d z = P gcd N z P z = 1 z = P P gcd N P P gcd N = 1 P gcd N = P
27 26 rspcv P gcd N z z P z = 1 z = P P gcd N P P gcd N = 1 P gcd N = P
28 21 27 syl5com P P gcd N P gcd N P P gcd N = 1 P gcd N = P
29 28 adantr P N P gcd N P gcd N P P gcd N = 1 P gcd N = P
30 18 19 29 mp2d P N P gcd N = 1 P gcd N = P
31 biorf ¬ P gcd N = P P gcd N = 1 P gcd N = P P gcd N = 1
32 orcom P gcd N = P P gcd N = 1 P gcd N = 1 P gcd N = P
33 31 32 bitrdi ¬ P gcd N = P P gcd N = 1 P gcd N = 1 P gcd N = P
34 30 33 syl5ibrcom P N ¬ P gcd N = P P gcd N = 1
35 7 34 syld P N ¬ P N P gcd N = 1
36 iddvds P P P
37 1 36 syl P P P
38 37 adantr P N P P
39 dvdslegcd P P N ¬ P = 0 N = 0 P P P N P P gcd N
40 39 ex P P N ¬ P = 0 N = 0 P P P N P P gcd N
41 40 3anidm12 P N ¬ P = 0 N = 0 P P P N P P gcd N
42 1 41 sylan P N ¬ P = 0 N = 0 P P P N P P gcd N
43 14 42 mpd P N P P P N P P gcd N
44 38 43 mpand P N P N P P gcd N
45 prmgt1 P 1 < P
46 45 adantr P N 1 < P
47 1re 1
48 1 zred P P
49 18 nnred P N P gcd N
50 ltletr 1 P P gcd N 1 < P P P gcd N 1 < P gcd N
51 47 48 49 50 mp3an2ani P N 1 < P P P gcd N 1 < P gcd N
52 46 51 mpand P N P P gcd N 1 < P gcd N
53 ltne 1 1 < P gcd N P gcd N 1
54 47 53 mpan 1 < P gcd N P gcd N 1
55 54 a1i P N 1 < P gcd N P gcd N 1
56 44 52 55 3syld P N P N P gcd N 1
57 56 necon2bd P N P gcd N = 1 ¬ P N
58 35 57 impbid P N ¬ P N P gcd N = 1