Metamath Proof Explorer


Theorem coprmdvds

Description: Euclid's Lemma (see ProofWiki "Euclid's Lemma", 10-Jul-2021, https://proofwiki.org/wiki/Euclid's_Lemma ): If an integer divides the product of two integers and is coprime to one of them, then it divides the other. See also theorem 1.5 in ApostolNT p. 16. Generalization of euclemma . (Contributed by Paul Chapman, 22-Jun-2011) (Proof shortened by AV, 10-Jul-2021)

Ref Expression
Assertion coprmdvds KMNK M NKgcdM=1KN

Proof

Step Hyp Ref Expression
1 zcn MM
2 zcn NN
3 mulcom MN M N= N M
4 1 2 3 syl2an MN M N= N M
5 4 breq2d MNK M NK N M
6 dvdsmulgcd NMK N MKNMgcdK
7 6 ancoms MNK N MKNMgcdK
8 5 7 bitrd MNK M NKNMgcdK
9 8 3adant1 KMNK M NKNMgcdK
10 9 adantr KMNKgcdM=1K M NKNMgcdK
11 gcdcom KMKgcdM=MgcdK
12 11 3adant3 KMNKgcdM=MgcdK
13 12 eqeq1d KMNKgcdM=1MgcdK=1
14 oveq2 MgcdK=1NMgcdK= N1
15 13 14 syl6bi KMNKgcdM=1NMgcdK= N1
16 15 imp KMNKgcdM=1NMgcdK= N1
17 2 mulridd N N1=N
18 17 3ad2ant3 KMN N1=N
19 18 adantr KMNKgcdM=1 N1=N
20 16 19 eqtrd KMNKgcdM=1NMgcdK=N
21 20 breq2d KMNKgcdM=1KNMgcdKKN
22 10 21 bitrd KMNKgcdM=1K M NKN
23 22 biimpd KMNKgcdM=1K M NKN
24 23 ex KMNKgcdM=1K M NKN
25 24 impcomd KMNK M NKgcdM=1KN