Metamath Proof Explorer


Theorem divgcdcoprm0

Description: Integers divided by gcd are coprime. (Contributed by AV, 12-Jul-2021)

Ref Expression
Assertion divgcdcoprm0 A B B 0 A A gcd B gcd B A gcd B = 1

Proof

Step Hyp Ref Expression
1 gcddvds A B A gcd B A A gcd B B
2 1 3adant3 A B B 0 A gcd B A A gcd B B
3 gcdcl A B A gcd B 0
4 3 nn0zd A B A gcd B
5 simpl A B A
6 4 5 jca A B A gcd B A
7 6 3adant3 A B B 0 A gcd B A
8 divides A gcd B A A gcd B A a a A gcd B = A
9 7 8 syl A B B 0 A gcd B A a a A gcd B = A
10 simpr A B B
11 4 10 jca A B A gcd B B
12 11 3adant3 A B B 0 A gcd B B
13 divides A gcd B B A gcd B B b b A gcd B = B
14 12 13 syl A B B 0 A gcd B B b b A gcd B = B
15 9 14 anbi12d A B B 0 A gcd B A A gcd B B a a A gcd B = A b b A gcd B = B
16 bezout A B m n A gcd B = A m + B n
17 16 3adant3 A B B 0 m n A gcd B = A m + B n
18 oveq1 a A gcd B = A a A gcd B m = A m
19 oveq1 b A gcd B = B b A gcd B n = B n
20 18 19 oveqan12rd b A gcd B = B a A gcd B = A a A gcd B m + b A gcd B n = A m + B n
21 20 eqeq2d b A gcd B = B a A gcd B = A A gcd B = a A gcd B m + b A gcd B n A gcd B = A m + B n
22 21 bicomd b A gcd B = B a A gcd B = A A gcd B = A m + B n A gcd B = a A gcd B m + b A gcd B n
23 simpl a b a
24 23 zcnd a b a
25 24 adantl A B B 0 m n a b a
26 3 nn0cnd A B A gcd B
27 26 3adant3 A B B 0 A gcd B
28 27 ad2antrr A B B 0 m n a b A gcd B
29 simpl m n m
30 29 zcnd m n m
31 30 ad2antlr A B B 0 m n a b m
32 25 28 31 mul32d A B B 0 m n a b a A gcd B m = a m A gcd B
33 simpr a b b
34 33 zcnd a b b
35 34 adantl A B B 0 m n a b b
36 simpr m n n
37 36 zcnd m n n
38 37 ad2antlr A B B 0 m n a b n
39 35 28 38 mul32d A B B 0 m n a b b A gcd B n = b n A gcd B
40 32 39 oveq12d A B B 0 m n a b a A gcd B m + b A gcd B n = a m A gcd B + b n A gcd B
41 40 eqeq2d A B B 0 m n a b A gcd B = a A gcd B m + b A gcd B n A gcd B = a m A gcd B + b n A gcd B
42 23 adantl A B B 0 m n a b a
43 29 ad2antlr A B B 0 m n a b m
44 42 43 zmulcld A B B 0 m n a b a m
45 4 3adant3 A B B 0 A gcd B
46 45 ad2antrr A B B 0 m n a b A gcd B
47 44 46 zmulcld A B B 0 m n a b a m A gcd B
48 33 adantl A B B 0 m n a b b
49 36 ad2antlr A B B 0 m n a b n
50 48 49 zmulcld A B B 0 m n a b b n
51 3 3adant3 A B B 0 A gcd B 0
52 51 ad2antrr A B B 0 m n a b A gcd B 0
53 52 nn0zd A B B 0 m n a b A gcd B
54 50 53 zmulcld A B B 0 m n a b b n A gcd B
55 47 54 zaddcld A B B 0 m n a b a m A gcd B + b n A gcd B
56 55 zcnd A B B 0 m n a b a m A gcd B + b n A gcd B
57 gcd2n0cl A B B 0 A gcd B
58 nnrp A gcd B A gcd B +
59 58 rpcnne0d A gcd B A gcd B A gcd B 0
60 57 59 syl A B B 0 A gcd B A gcd B 0
61 60 ad2antrr A B B 0 m n a b A gcd B A gcd B 0
62 div11 A gcd B a m A gcd B + b n A gcd B A gcd B A gcd B 0 A gcd B A gcd B = a m A gcd B + b n A gcd B A gcd B A gcd B = a m A gcd B + b n A gcd B
63 28 56 61 62 syl3anc A B B 0 m n a b A gcd B A gcd B = a m A gcd B + b n A gcd B A gcd B A gcd B = a m A gcd B + b n A gcd B
64 divid A gcd B A gcd B 0 A gcd B A gcd B = 1
65 61 64 syl A B B 0 m n a b A gcd B A gcd B = 1
66 47 zcnd A B B 0 m n a b a m A gcd B
67 54 zcnd A B B 0 m n a b b n A gcd B
68 divdir a m A gcd B b n A gcd B A gcd B A gcd B 0 a m A gcd B + b n A gcd B A gcd B = a m A gcd B A gcd B + b n A gcd B A gcd B
69 66 67 61 68 syl3anc A B B 0 m n a b a m A gcd B + b n A gcd B A gcd B = a m A gcd B A gcd B + b n A gcd B A gcd B
70 44 zcnd A B B 0 m n a b a m
71 51 nn0cnd A B B 0 A gcd B
72 71 ad2antrr A B B 0 m n a b A gcd B
73 57 nnne0d A B B 0 A gcd B 0
74 73 ad2antrr A B B 0 m n a b A gcd B 0
75 70 72 74 divcan4d A B B 0 m n a b a m A gcd B A gcd B = a m
76 50 zcnd A B B 0 m n a b b n
77 76 28 74 divcan4d A B B 0 m n a b b n A gcd B A gcd B = b n
78 75 77 oveq12d A B B 0 m n a b a m A gcd B A gcd B + b n A gcd B A gcd B = a m + b n
79 69 78 eqtrd A B B 0 m n a b a m A gcd B + b n A gcd B A gcd B = a m + b n
80 65 79 eqeq12d A B B 0 m n a b A gcd B A gcd B = a m A gcd B + b n A gcd B A gcd B 1 = a m + b n
81 41 63 80 3bitr2d A B B 0 m n a b A gcd B = a A gcd B m + b A gcd B n 1 = a m + b n
82 22 81 sylan9bbr A B B 0 m n a b b A gcd B = B a A gcd B = A A gcd B = A m + B n 1 = a m + b n
83 eqcom 1 = a m + b n a m + b n = 1
84 simpr A B B 0 m n m n
85 84 anim1ci A B B 0 m n a b a b m n
86 bezoutr1 a b m n a m + b n = 1 a gcd b = 1
87 85 86 syl A B B 0 m n a b a m + b n = 1 a gcd b = 1
88 87 adantr A B B 0 m n a b b A gcd B = B a A gcd B = A a m + b n = 1 a gcd b = 1
89 83 88 syl5bi A B B 0 m n a b b A gcd B = B a A gcd B = A 1 = a m + b n a gcd b = 1
90 simpll1 A B B 0 m n a b A
91 90 zcnd A B B 0 m n a b A
92 divmul3 A a A gcd B A gcd B 0 A A gcd B = a A = a A gcd B
93 91 25 61 92 syl3anc A B B 0 m n a b A A gcd B = a A = a A gcd B
94 eqcom a = A A gcd B A A gcd B = a
95 eqcom a A gcd B = A A = a A gcd B
96 93 94 95 3bitr4g A B B 0 m n a b a = A A gcd B a A gcd B = A
97 96 biimprd A B B 0 m n a b a A gcd B = A a = A A gcd B
98 97 a1d A B B 0 m n a b b A gcd B = B a A gcd B = A a = A A gcd B
99 98 imp32 A B B 0 m n a b b A gcd B = B a A gcd B = A a = A A gcd B
100 simp2 A B B 0 B
101 100 zcnd A B B 0 B
102 101 ad2antrr A B B 0 m n a b B
103 divmul3 B b A gcd B A gcd B 0 B A gcd B = b B = b A gcd B
104 102 35 61 103 syl3anc A B B 0 m n a b B A gcd B = b B = b A gcd B
105 eqcom b = B A gcd B B A gcd B = b
106 eqcom b A gcd B = B B = b A gcd B
107 104 105 106 3bitr4g A B B 0 m n a b b = B A gcd B b A gcd B = B
108 107 biimprd A B B 0 m n a b b A gcd B = B b = B A gcd B
109 108 a1dd A B B 0 m n a b b A gcd B = B a A gcd B = A b = B A gcd B
110 109 imp32 A B B 0 m n a b b A gcd B = B a A gcd B = A b = B A gcd B
111 99 110 oveq12d A B B 0 m n a b b A gcd B = B a A gcd B = A a gcd b = A A gcd B gcd B A gcd B
112 111 eqeq1d A B B 0 m n a b b A gcd B = B a A gcd B = A a gcd b = 1 A A gcd B gcd B A gcd B = 1
113 89 112 sylibd A B B 0 m n a b b A gcd B = B a A gcd B = A 1 = a m + b n A A gcd B gcd B A gcd B = 1
114 82 113 sylbid A B B 0 m n a b b A gcd B = B a A gcd B = A A gcd B = A m + B n A A gcd B gcd B A gcd B = 1
115 114 exp32 A B B 0 m n a b b A gcd B = B a A gcd B = A A gcd B = A m + B n A A gcd B gcd B A gcd B = 1
116 115 com34 A B B 0 m n a b b A gcd B = B A gcd B = A m + B n a A gcd B = A A A gcd B gcd B A gcd B = 1
117 116 com23 A B B 0 m n a b A gcd B = A m + B n b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
118 117 ex A B B 0 m n a b A gcd B = A m + B n b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
119 118 com23 A B B 0 m n A gcd B = A m + B n a b b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
120 119 rexlimdvva A B B 0 m n A gcd B = A m + B n a b b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
121 17 120 mpd A B B 0 a b b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
122 121 impl A B B 0 a b b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
123 122 rexlimdva A B B 0 a b b A gcd B = B a A gcd B = A A A gcd B gcd B A gcd B = 1
124 123 com23 A B B 0 a a A gcd B = A b b A gcd B = B A A gcd B gcd B A gcd B = 1
125 124 rexlimdva A B B 0 a a A gcd B = A b b A gcd B = B A A gcd B gcd B A gcd B = 1
126 125 impd A B B 0 a a A gcd B = A b b A gcd B = B A A gcd B gcd B A gcd B = 1
127 15 126 sylbid A B B 0 A gcd B A A gcd B B A A gcd B gcd B A gcd B = 1
128 2 127 mpd A B B 0 A A gcd B gcd B A gcd B = 1