Metamath Proof Explorer


Theorem rpdvds

Description: If K is relatively prime to N then it is also relatively prime to any divisor M of N . (Contributed by Mario Carneiro, 19-Jun-2015)

Ref Expression
Assertion rpdvds
|- ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) = 1 )

Proof

Step Hyp Ref Expression
1 simpl1
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> K e. ZZ )
2 simpl2
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> M e. ZZ )
3 gcddvds
 |-  ( ( K e. ZZ /\ M e. ZZ ) -> ( ( K gcd M ) || K /\ ( K gcd M ) || M ) )
4 1 2 3 syl2anc
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K gcd M ) || K /\ ( K gcd M ) || M ) )
5 4 simpld
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) || K )
6 ax-1ne0
 |-  1 =/= 0
7 simprl
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd N ) = 1 )
8 7 neeq1d
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K gcd N ) =/= 0 <-> 1 =/= 0 ) )
9 6 8 mpbiri
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd N ) =/= 0 )
10 9 neneqd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> -. ( K gcd N ) = 0 )
11 simprl
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> K = 0 )
12 simprr
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> M = 0 )
13 simplrr
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> M || N )
14 12 13 eqbrtrrd
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> 0 || N )
15 simpll3
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> N e. ZZ )
16 0dvds
 |-  ( N e. ZZ -> ( 0 || N <-> N = 0 ) )
17 15 16 syl
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> ( 0 || N <-> N = 0 ) )
18 14 17 mpbid
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> N = 0 )
19 11 18 jca
 |-  ( ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) /\ ( K = 0 /\ M = 0 ) ) -> ( K = 0 /\ N = 0 ) )
20 19 ex
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K = 0 /\ M = 0 ) -> ( K = 0 /\ N = 0 ) ) )
21 simpl3
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> N e. ZZ )
22 gcdeq0
 |-  ( ( K e. ZZ /\ N e. ZZ ) -> ( ( K gcd N ) = 0 <-> ( K = 0 /\ N = 0 ) ) )
23 1 21 22 syl2anc
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K gcd N ) = 0 <-> ( K = 0 /\ N = 0 ) ) )
24 20 23 sylibrd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K = 0 /\ M = 0 ) -> ( K gcd N ) = 0 ) )
25 10 24 mtod
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> -. ( K = 0 /\ M = 0 ) )
26 gcdn0cl
 |-  ( ( ( K e. ZZ /\ M e. ZZ ) /\ -. ( K = 0 /\ M = 0 ) ) -> ( K gcd M ) e. NN )
27 1 2 25 26 syl21anc
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) e. NN )
28 27 nnzd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) e. ZZ )
29 4 simprd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) || M )
30 simprr
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> M || N )
31 28 2 21 29 30 dvdstrd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) || N )
32 10 23 mtbid
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> -. ( K = 0 /\ N = 0 ) )
33 dvdslegcd
 |-  ( ( ( ( K gcd M ) e. ZZ /\ K e. ZZ /\ N e. ZZ ) /\ -. ( K = 0 /\ N = 0 ) ) -> ( ( ( K gcd M ) || K /\ ( K gcd M ) || N ) -> ( K gcd M ) <_ ( K gcd N ) ) )
34 28 1 21 32 33 syl31anc
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( ( K gcd M ) || K /\ ( K gcd M ) || N ) -> ( K gcd M ) <_ ( K gcd N ) ) )
35 5 31 34 mp2and
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) <_ ( K gcd N ) )
36 35 7 breqtrd
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) <_ 1 )
37 nnle1eq1
 |-  ( ( K gcd M ) e. NN -> ( ( K gcd M ) <_ 1 <-> ( K gcd M ) = 1 ) )
38 27 37 syl
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( ( K gcd M ) <_ 1 <-> ( K gcd M ) = 1 ) )
39 36 38 mpbid
 |-  ( ( ( K e. ZZ /\ M e. ZZ /\ N e. ZZ ) /\ ( ( K gcd N ) = 1 /\ M || N ) ) -> ( K gcd M ) = 1 )