Metamath Proof Explorer


Theorem qredeq

Description: Two equal reduced fractions have the same numerator and denominator. (Contributed by Jeff Hankins, 29-Sep-2013)

Ref Expression
Assertion qredeq M N M gcd N = 1 P Q P gcd Q = 1 M N = P Q M = P N = Q

Proof

Step Hyp Ref Expression
1 zcn M M
2 1 adantr M N M
3 nncn N N
4 3 adantl M N N
5 nnne0 N N 0
6 5 adantl M N N 0
7 2 4 6 divcld M N M N
8 7 3adant3 M N M gcd N = 1 M N
9 8 adantr M N M gcd N = 1 P Q P gcd Q = 1 M N
10 zcn P P
11 10 adantr P Q P
12 nncn Q Q
13 12 adantl P Q Q
14 nnne0 Q Q 0
15 14 adantl P Q Q 0
16 11 13 15 divcld P Q P Q
17 16 3adant3 P Q P gcd Q = 1 P Q
18 17 adantl M N M gcd N = 1 P Q P gcd Q = 1 P Q
19 3 3ad2ant2 M N M gcd N = 1 N
20 19 adantr M N M gcd N = 1 P Q P gcd Q = 1 N
21 5 3ad2ant2 M N M gcd N = 1 N 0
22 21 adantr M N M gcd N = 1 P Q P gcd Q = 1 N 0
23 9 18 20 22 mulcand M N M gcd N = 1 P Q P gcd Q = 1 N M N = N P Q M N = P Q
24 2 4 6 divcan2d M N N M N = M
25 24 3adant3 M N M gcd N = 1 N M N = M
26 25 adantr M N M gcd N = 1 P Q P gcd Q = 1 N M N = M
27 26 eqeq1d M N M gcd N = 1 P Q P gcd Q = 1 N M N = N P Q M = N P Q
28 23 27 bitr3d M N M gcd N = 1 P Q P gcd Q = 1 M N = P Q M = N P Q
29 1 3ad2ant1 M N M gcd N = 1 M
30 29 adantr M N M gcd N = 1 P Q P gcd Q = 1 M
31 mulcl N P Q N P Q
32 19 17 31 syl2an M N M gcd N = 1 P Q P gcd Q = 1 N P Q
33 12 3ad2ant2 P Q P gcd Q = 1 Q
34 33 adantl M N M gcd N = 1 P Q P gcd Q = 1 Q
35 14 3ad2ant2 P Q P gcd Q = 1 Q 0
36 35 adantl M N M gcd N = 1 P Q P gcd Q = 1 Q 0
37 30 32 34 36 mulcan2d M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q Q M = N P Q
38 20 18 34 mulassd M N M gcd N = 1 P Q P gcd Q = 1 N P Q Q = N P Q Q
39 11 13 15 divcan1d P Q P Q Q = P
40 39 3adant3 P Q P gcd Q = 1 P Q Q = P
41 40 adantl M N M gcd N = 1 P Q P gcd Q = 1 P Q Q = P
42 41 oveq2d M N M gcd N = 1 P Q P gcd Q = 1 N P Q Q = N P
43 38 42 eqtrd M N M gcd N = 1 P Q P gcd Q = 1 N P Q Q = N P
44 43 eqeq2d M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q Q M Q = N P
45 37 44 bitr3d M N M gcd N = 1 P Q P gcd Q = 1 M = N P Q M Q = N P
46 28 45 bitrd M N M gcd N = 1 P Q P gcd Q = 1 M N = P Q M Q = N P
47 nnz N N
48 47 3ad2ant2 M N M gcd N = 1 N
49 simp2 P Q P gcd Q = 1 Q
50 48 49 anim12i M N M gcd N = 1 P Q P gcd Q = 1 N Q
51 50 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N Q
52 48 adantr M N M gcd N = 1 P Q P gcd Q = 1 N
53 simpl1 M N M gcd N = 1 P Q P gcd Q = 1 M
54 nnz Q Q
55 54 3ad2ant2 P Q P gcd Q = 1 Q
56 55 adantl M N M gcd N = 1 P Q P gcd Q = 1 Q
57 52 53 56 3jca M N M gcd N = 1 P Q P gcd Q = 1 N M Q
58 57 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N M Q
59 simp1 P Q P gcd Q = 1 P
60 dvdsmul1 N P N N P
61 48 59 60 syl2an M N M gcd N = 1 P Q P gcd Q = 1 N N P
62 61 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N N P
63 simpr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P M Q = N P
64 62 63 breqtrrd M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N M Q
65 gcdcom N M N gcd M = M gcd N
66 47 65 sylan N M N gcd M = M gcd N
67 66 ancoms M N N gcd M = M gcd N
68 67 3adant3 M N M gcd N = 1 N gcd M = M gcd N
69 simp3 M N M gcd N = 1 M gcd N = 1
70 68 69 eqtrd M N M gcd N = 1 N gcd M = 1
71 70 ad2antrr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N gcd M = 1
72 64 71 jca M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N M Q N gcd M = 1
73 coprmdvds N M Q N M Q N gcd M = 1 N Q
74 58 72 73 sylc M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N Q
75 dvdsle N Q N Q N Q
76 51 74 75 sylc M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N Q
77 simp2 M N M gcd N = 1 N
78 55 77 anim12i P Q P gcd Q = 1 M N M gcd N = 1 Q N
79 78 ancoms M N M gcd N = 1 P Q P gcd Q = 1 Q N
80 79 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q N
81 simpr1 M N M gcd N = 1 P Q P gcd Q = 1 P
82 56 81 52 3jca M N M gcd N = 1 P Q P gcd Q = 1 Q P N
83 82 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q P N
84 simp1 M N M gcd N = 1 M
85 dvdsmul2 M Q Q M Q
86 84 55 85 syl2an M N M gcd N = 1 P Q P gcd Q = 1 Q M Q
87 86 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q M Q
88 10 3ad2ant1 P Q P gcd Q = 1 P
89 mulcom N P N P = P N
90 19 88 89 syl2an M N M gcd N = 1 P Q P gcd Q = 1 N P = P N
91 90 adantr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N P = P N
92 63 91 eqtrd M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P M Q = P N
93 87 92 breqtrd M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q P N
94 gcdcom Q P Q gcd P = P gcd Q
95 54 94 sylan Q P Q gcd P = P gcd Q
96 95 ancoms P Q Q gcd P = P gcd Q
97 96 3adant3 P Q P gcd Q = 1 Q gcd P = P gcd Q
98 simp3 P Q P gcd Q = 1 P gcd Q = 1
99 97 98 eqtrd P Q P gcd Q = 1 Q gcd P = 1
100 99 ad2antlr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q gcd P = 1
101 93 100 jca M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q P N Q gcd P = 1
102 coprmdvds Q P N Q P N Q gcd P = 1 Q N
103 83 101 102 sylc M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q N
104 dvdsle Q N Q N Q N
105 80 103 104 sylc M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q N
106 nnre N N
107 106 3ad2ant2 M N M gcd N = 1 N
108 107 ad2antrr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N
109 nnre Q Q
110 109 3ad2ant2 P Q P gcd Q = 1 Q
111 110 ad2antlr M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P Q
112 108 111 letri3d M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N = Q N Q Q N
113 76 105 112 mpbir2and M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N = Q
114 oveq2 N = Q M N = M Q
115 114 eqeq1d N = Q M N = N P M Q = N P
116 115 anbi2d N = Q M N M gcd N = 1 P Q P gcd Q = 1 M N = N P M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P
117 mulcom M N M N = N M
118 1 3 117 syl2an M N M N = N M
119 118 3adant3 M N M gcd N = 1 M N = N M
120 119 adantr M N M gcd N = 1 P Q P gcd Q = 1 M N = N M
121 120 eqeq1d M N M gcd N = 1 P Q P gcd Q = 1 M N = N P N M = N P
122 88 adantl M N M gcd N = 1 P Q P gcd Q = 1 P
123 30 122 20 22 mulcand M N M gcd N = 1 P Q P gcd Q = 1 N M = N P M = P
124 121 123 bitrd M N M gcd N = 1 P Q P gcd Q = 1 M N = N P M = P
125 124 biimpa M N M gcd N = 1 P Q P gcd Q = 1 M N = N P M = P
126 116 125 syl6bir N = Q M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P M = P
127 126 com12 M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N = Q M = P
128 127 ancrd M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P N = Q M = P N = Q
129 113 128 mpd M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P M = P N = Q
130 129 ex M N M gcd N = 1 P Q P gcd Q = 1 M Q = N P M = P N = Q
131 46 130 sylbid M N M gcd N = 1 P Q P gcd Q = 1 M N = P Q M = P N = Q
132 131 3impia M N M gcd N = 1 P Q P gcd Q = 1 M N = P Q M = P N = Q