Metamath Proof Explorer


Theorem divgcdcoprmex

Description: Integers divided by gcd are coprime (see ProofWiki "Integers Divided by GCD are Coprime", 11-Jul-2021, https://proofwiki.org/wiki/Integers_Divided_by_GCD_are_Coprime ): Any pair of integers, not both zero, can be reduced to a pair of coprime ones by dividing them by their gcd. (Contributed by AV, 12-Jul-2021)

Ref Expression
Assertion divgcdcoprmex A B B 0 M = A gcd B a b A = M a B = M b a gcd b = 1

Proof

Step Hyp Ref Expression
1 simpl B B 0 B
2 1 anim2i A B B 0 A B
3 zeqzmulgcd A B a A = a A gcd B
4 2 3 syl A B B 0 a A = a A gcd B
5 4 3adant3 A B B 0 M = A gcd B a A = a A gcd B
6 zeqzmulgcd B A b B = b B gcd A
7 6 adantlr B B 0 A b B = b B gcd A
8 7 ancoms A B B 0 b B = b B gcd A
9 8 3adant3 A B B 0 M = A gcd B b B = b B gcd A
10 reeanv a b A = a A gcd B B = b B gcd A a A = a A gcd B b B = b B gcd A
11 zcn a a
12 11 adantl A B B 0 M = A gcd B a a
13 gcdcl A B A gcd B 0
14 2 13 syl A B B 0 A gcd B 0
15 14 nn0cnd A B B 0 A gcd B
16 15 3adant3 A B B 0 M = A gcd B A gcd B
17 16 adantr A B B 0 M = A gcd B a A gcd B
18 12 17 mulcomd A B B 0 M = A gcd B a a A gcd B = A gcd B a
19 simp3 A B B 0 M = A gcd B M = A gcd B
20 19 eqcomd A B B 0 M = A gcd B A gcd B = M
21 20 oveq1d A B B 0 M = A gcd B A gcd B a = M a
22 21 adantr A B B 0 M = A gcd B a A gcd B a = M a
23 18 22 eqtrd A B B 0 M = A gcd B a a A gcd B = M a
24 23 ad2antrr A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A a A gcd B = M a
25 eqeq1 A = a A gcd B A = M a a A gcd B = M a
26 25 adantr A = a A gcd B B = b B gcd A A = M a a A gcd B = M a
27 26 adantl A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A A = M a a A gcd B = M a
28 24 27 mpbird A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A A = M a
29 simpr A = a A gcd B B = b B gcd A B = b B gcd A
30 2 ancomd A B B 0 B A
31 gcdcom B A B gcd A = A gcd B
32 30 31 syl A B B 0 B gcd A = A gcd B
33 32 3adant3 A B B 0 M = A gcd B B gcd A = A gcd B
34 33 oveq2d A B B 0 M = A gcd B b B gcd A = b A gcd B
35 34 adantr A B B 0 M = A gcd B b b B gcd A = b A gcd B
36 zcn b b
37 36 adantl A B B 0 M = A gcd B b b
38 14 3adant3 A B B 0 M = A gcd B A gcd B 0
39 38 adantr A B B 0 M = A gcd B b A gcd B 0
40 39 nn0cnd A B B 0 M = A gcd B b A gcd B
41 37 40 mulcomd A B B 0 M = A gcd B b b A gcd B = A gcd B b
42 20 adantr A B B 0 M = A gcd B b A gcd B = M
43 42 oveq1d A B B 0 M = A gcd B b A gcd B b = M b
44 35 41 43 3eqtrd A B B 0 M = A gcd B b b B gcd A = M b
45 44 adantlr A B B 0 M = A gcd B a b b B gcd A = M b
46 29 45 sylan9eqr A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A B = M b
47 zcn A A
48 47 3ad2ant1 A B B 0 M = A gcd B A
49 48 ad2antrr A B B 0 M = A gcd B a b A
50 12 adantr A B B 0 M = A gcd B a b a
51 simp1 A B B 0 M = A gcd B A
52 1 3ad2ant2 A B B 0 M = A gcd B B
53 51 52 gcdcld A B B 0 M = A gcd B A gcd B 0
54 53 nn0cnd A B B 0 M = A gcd B A gcd B
55 54 ad2antrr A B B 0 M = A gcd B a b A gcd B
56 gcdeq0 A B A gcd B = 0 A = 0 B = 0
57 simpr A = 0 B = 0 B = 0
58 56 57 syl6bi A B A gcd B = 0 B = 0
59 58 necon3d A B B 0 A gcd B 0
60 59 impr A B B 0 A gcd B 0
61 60 3adant3 A B B 0 M = A gcd B A gcd B 0
62 61 ad2antrr A B B 0 M = A gcd B a b A gcd B 0
63 49 50 55 62 divmul3d A B B 0 M = A gcd B a b A A gcd B = a A = a A gcd B
64 63 bicomd A B B 0 M = A gcd B a b A = a A gcd B A A gcd B = a
65 zcn B B
66 65 adantr B B 0 B
67 66 3ad2ant2 A B B 0 M = A gcd B B
68 67 ad2antrr A B B 0 M = A gcd B a b B
69 36 adantl A B B 0 M = A gcd B a b b
70 68 69 55 62 divmul3d A B B 0 M = A gcd B a b B A gcd B = b B = b A gcd B
71 2 3adant3 A B B 0 M = A gcd B A B
72 gcdcom A B A gcd B = B gcd A
73 71 72 syl A B B 0 M = A gcd B A gcd B = B gcd A
74 73 ad2antrr A B B 0 M = A gcd B a b A gcd B = B gcd A
75 74 oveq2d A B B 0 M = A gcd B a b b A gcd B = b B gcd A
76 75 eqeq2d A B B 0 M = A gcd B a b B = b A gcd B B = b B gcd A
77 70 76 bitr2d A B B 0 M = A gcd B a b B = b B gcd A B A gcd B = b
78 64 77 anbi12d A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A A A gcd B = a B A gcd B = b
79 3anass A B B 0 A B B 0
80 79 biimpri A B B 0 A B B 0
81 80 3adant3 A B B 0 M = A gcd B A B B 0
82 divgcdcoprm0 A B B 0 A A gcd B gcd B A gcd B = 1
83 81 82 syl A B B 0 M = A gcd B A A gcd B gcd B A gcd B = 1
84 oveq12 A A gcd B = a B A gcd B = b A A gcd B gcd B A gcd B = a gcd b
85 84 eqeq1d A A gcd B = a B A gcd B = b A A gcd B gcd B A gcd B = 1 a gcd b = 1
86 83 85 syl5ibcom A B B 0 M = A gcd B A A gcd B = a B A gcd B = b a gcd b = 1
87 86 ad2antrr A B B 0 M = A gcd B a b A A gcd B = a B A gcd B = b a gcd b = 1
88 78 87 sylbid A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A a gcd b = 1
89 88 imp A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A a gcd b = 1
90 28 46 89 3jca A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A A = M a B = M b a gcd b = 1
91 90 ex A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A A = M a B = M b a gcd b = 1
92 91 reximdva A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A b A = M a B = M b a gcd b = 1
93 92 reximdva A B B 0 M = A gcd B a b A = a A gcd B B = b B gcd A a b A = M a B = M b a gcd b = 1
94 10 93 syl5bir A B B 0 M = A gcd B a A = a A gcd B b B = b B gcd A a b A = M a B = M b a gcd b = 1
95 5 9 94 mp2and A B B 0 M = A gcd B a b A = M a B = M b a gcd b = 1