Metamath Proof Explorer


Theorem dvdsgcd

Description: An integer which divides each of two others also divides their gcd. (Contributed by Paul Chapman, 22-Jun-2011) (Revised by Mario Carneiro, 30-May-2014)

Ref Expression
Assertion dvdsgcd KMNKMKNKMgcdN

Proof

Step Hyp Ref Expression
1 bezout MNxyMgcdN=Mx+Ny
2 1 3adant1 KMNxyMgcdN=Mx+Ny
3 dvds2ln xyKMNKMKNKx M+y N
4 3 3impia xyKMNKMKNKx M+y N
5 4 3coml KMNKMKNxyKx M+y N
6 simp3l KMNKMKNxyx
7 simp12 KMNKMKNxyM
8 zcn xx
9 zcn MM
10 mulcom xMx M=Mx
11 8 9 10 syl2an xMx M=Mx
12 6 7 11 syl2anc KMNKMKNxyx M=Mx
13 simp3r KMNKMKNxyy
14 simp13 KMNKMKNxyN
15 zcn yy
16 zcn NN
17 mulcom yNy N=Ny
18 15 16 17 syl2an yNy N=Ny
19 13 14 18 syl2anc KMNKMKNxyy N=Ny
20 12 19 oveq12d KMNKMKNxyx M+y N=Mx+Ny
21 5 20 breqtrd KMNKMKNxyKMx+Ny
22 breq2 MgcdN=Mx+NyKMgcdNKMx+Ny
23 21 22 syl5ibrcom KMNKMKNxyMgcdN=Mx+NyKMgcdN
24 23 3expia KMNKMKNxyMgcdN=Mx+NyKMgcdN
25 24 rexlimdvv KMNKMKNxyMgcdN=Mx+NyKMgcdN
26 25 ex KMNKMKNxyMgcdN=Mx+NyKMgcdN
27 2 26 mpid KMNKMKNKMgcdN