Metamath Proof Explorer


Theorem qredeu

Description: Every rational number has a unique reduced form. (Contributed by Jeff Hankins, 29-Sep-2013)

Ref Expression
Assertion qredeu A ∃! x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x

Proof

Step Hyp Ref Expression
1 nnz n n
2 gcddvds z n z gcd n z z gcd n n
3 2 simpld z n z gcd n z
4 1 3 sylan2 z n z gcd n z
5 gcdcl z n z gcd n 0
6 1 5 sylan2 z n z gcd n 0
7 6 nn0zd z n z gcd n
8 simpl z n z
9 1 adantl z n n
10 nnne0 n n 0
11 10 neneqd n ¬ n = 0
12 11 intnand n ¬ z = 0 n = 0
13 12 adantl z n ¬ z = 0 n = 0
14 gcdn0cl z n ¬ z = 0 n = 0 z gcd n
15 8 9 13 14 syl21anc z n z gcd n
16 nnne0 z gcd n z gcd n 0
17 15 16 syl z n z gcd n 0
18 dvdsval2 z gcd n z gcd n 0 z z gcd n z z z gcd n
19 7 17 8 18 syl3anc z n z gcd n z z z gcd n
20 4 19 mpbid z n z z gcd n
21 20 3adant3 z n A = z n z z gcd n
22 2 simprd z n z gcd n n
23 1 22 sylan2 z n z gcd n n
24 dvdsval2 z gcd n z gcd n 0 n z gcd n n n z gcd n
25 7 17 9 24 syl3anc z n z gcd n n n z gcd n
26 23 25 mpbid z n n z gcd n
27 nnre n n
28 27 adantl z n n
29 6 nn0red z n z gcd n
30 nngt0 n 0 < n
31 30 adantl z n 0 < n
32 nngt0 z gcd n 0 < z gcd n
33 15 32 syl z n 0 < z gcd n
34 28 29 31 33 divgt0d z n 0 < n z gcd n
35 26 34 jca z n n z gcd n 0 < n z gcd n
36 35 3adant3 z n A = z n n z gcd n 0 < n z gcd n
37 elnnz n z gcd n n z gcd n 0 < n z gcd n
38 36 37 sylibr z n A = z n n z gcd n
39 21 38 opelxpd z n A = z n z z gcd n n z gcd n ×
40 20 26 gcdcld z n z z gcd n gcd n z gcd n 0
41 40 nn0cnd z n z z gcd n gcd n z gcd n
42 1cnd z n 1
43 6 nn0cnd z n z gcd n
44 43 mulid1d z n z gcd n 1 = z gcd n
45 zcn z z
46 45 adantr z n z
47 46 43 17 divcan2d z n z gcd n z z gcd n = z
48 nncn n n
49 48 adantl z n n
50 49 43 17 divcan2d z n z gcd n n z gcd n = n
51 47 50 oveq12d z n z gcd n z z gcd n gcd z gcd n n z gcd n = z gcd n
52 mulgcd z gcd n 0 z z gcd n n z gcd n z gcd n z z gcd n gcd z gcd n n z gcd n = z gcd n z z gcd n gcd n z gcd n
53 6 20 26 52 syl3anc z n z gcd n z z gcd n gcd z gcd n n z gcd n = z gcd n z z gcd n gcd n z gcd n
54 44 51 53 3eqtr2rd z n z gcd n z z gcd n gcd n z gcd n = z gcd n 1
55 41 42 43 17 54 mulcanad z n z z gcd n gcd n z gcd n = 1
56 55 3adant3 z n A = z n z z gcd n gcd n z gcd n = 1
57 10 adantl z n n 0
58 46 49 43 57 17 divcan7d z n z z gcd n n z gcd n = z n
59 58 eqeq2d z n A = z z gcd n n z gcd n A = z n
60 59 biimp3ar z n A = z n A = z z gcd n n z gcd n
61 ovex z z gcd n V
62 ovex n z gcd n V
63 61 62 op1std x = z z gcd n n z gcd n 1 st x = z z gcd n
64 61 62 op2ndd x = z z gcd n n z gcd n 2 nd x = n z gcd n
65 63 64 oveq12d x = z z gcd n n z gcd n 1 st x gcd 2 nd x = z z gcd n gcd n z gcd n
66 65 eqeq1d x = z z gcd n n z gcd n 1 st x gcd 2 nd x = 1 z z gcd n gcd n z gcd n = 1
67 63 64 oveq12d x = z z gcd n n z gcd n 1 st x 2 nd x = z z gcd n n z gcd n
68 67 eqeq2d x = z z gcd n n z gcd n A = 1 st x 2 nd x A = z z gcd n n z gcd n
69 66 68 anbi12d x = z z gcd n n z gcd n 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x z z gcd n gcd n z gcd n = 1 A = z z gcd n n z gcd n
70 69 rspcev z z gcd n n z gcd n × z z gcd n gcd n z gcd n = 1 A = z z gcd n n z gcd n x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x
71 39 56 60 70 syl12anc z n A = z n x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x
72 elxp6 x × x = 1 st x 2 nd x 1 st x 2 nd x
73 elxp6 y × y = 1 st y 2 nd y 1 st y 2 nd y
74 simprl x = 1 st x 2 nd x 1 st x 2 nd x 1 st x
75 74 ad2antrr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st x
76 simprr x = 1 st x 2 nd x 1 st x 2 nd x 2 nd x
77 76 ad2antrr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 2 nd x
78 simprll x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st x gcd 2 nd x = 1
79 simprl y = 1 st y 2 nd y 1 st y 2 nd y 1 st y
80 79 ad2antlr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st y
81 simprr y = 1 st y 2 nd y 1 st y 2 nd y 2 nd y
82 81 ad2antlr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 2 nd y
83 simprrl x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st y gcd 2 nd y = 1
84 simprlr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y A = 1 st x 2 nd x
85 simprrr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y A = 1 st y 2 nd y
86 84 85 eqtr3d x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st x 2 nd x = 1 st y 2 nd y
87 qredeq 1 st x 2 nd x 1 st x gcd 2 nd x = 1 1 st y 2 nd y 1 st y gcd 2 nd y = 1 1 st x 2 nd x = 1 st y 2 nd y 1 st x = 1 st y 2 nd x = 2 nd y
88 75 77 78 80 82 83 86 87 syl331anc x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st x = 1 st y 2 nd x = 2 nd y
89 fvex 1 st x V
90 fvex 2 nd x V
91 89 90 opth 1 st x 2 nd x = 1 st y 2 nd y 1 st x = 1 st y 2 nd x = 2 nd y
92 88 91 sylibr x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y 1 st x 2 nd x = 1 st y 2 nd y
93 simplll x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = 1 st x 2 nd x
94 simplrl x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y y = 1 st y 2 nd y
95 92 93 94 3eqtr4d x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
96 95 ex x = 1 st x 2 nd x 1 st x 2 nd x y = 1 st y 2 nd y 1 st y 2 nd y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
97 72 73 96 syl2anb x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
98 97 rgen2 x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
99 71 98 jctir z n A = z n x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
100 99 3expia z n A = z n x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
101 100 rexlimivv z n A = z n x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
102 elq A z n A = z n
103 fveq2 x = y 1 st x = 1 st y
104 fveq2 x = y 2 nd x = 2 nd y
105 103 104 oveq12d x = y 1 st x gcd 2 nd x = 1 st y gcd 2 nd y
106 105 eqeq1d x = y 1 st x gcd 2 nd x = 1 1 st y gcd 2 nd y = 1
107 103 104 oveq12d x = y 1 st x 2 nd x = 1 st y 2 nd y
108 107 eqeq2d x = y A = 1 st x 2 nd x A = 1 st y 2 nd y
109 106 108 anbi12d x = y 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y
110 109 reu4 ∃! x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x x × y × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x 1 st y gcd 2 nd y = 1 A = 1 st y 2 nd y x = y
111 101 102 110 3imtr4i A ∃! x × 1 st x gcd 2 nd x = 1 A = 1 st x 2 nd x