Metamath Proof Explorer


Theorem qnumdenbi

Description: Two numbers are the canonical representation of a rational iff they are coprime and have the right quotient. (Contributed by Stefan O'Rear, 13-Sep-2014)

Ref Expression
Assertion qnumdenbi A B C B gcd C = 1 A = B C numer A = B denom A = C

Proof

Step Hyp Ref Expression
1 qredeu A ∃! a × 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
2 riotacl ∃! a × 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a ×
3 1st2nd2 ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a × ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = 1 st ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a 2 nd ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
4 1 2 3 3syl A ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = 1 st ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a 2 nd ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
5 qnumval A numer A = 1 st ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
6 qdenval A denom A = 2 nd ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
7 5 6 opeq12d A numer A denom A = 1 st ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a 2 nd ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
8 4 7 eqtr4d A ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = numer A denom A
9 8 eqeq1d A ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = B C numer A denom A = B C
10 9 3ad2ant1 A B C ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = B C numer A denom A = B C
11 fvex numer A V
12 fvex denom A V
13 11 12 opth numer A denom A = B C numer A = B denom A = C
14 10 13 bitr2di A B C numer A = B denom A = C ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = B C
15 opelxpi B C B C ×
16 15 3adant1 A B C B C ×
17 1 3ad2ant1 A B C ∃! a × 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a
18 fveq2 a = B C 1 st a = 1 st B C
19 fveq2 a = B C 2 nd a = 2 nd B C
20 18 19 oveq12d a = B C 1 st a gcd 2 nd a = 1 st B C gcd 2 nd B C
21 20 eqeq1d a = B C 1 st a gcd 2 nd a = 1 1 st B C gcd 2 nd B C = 1
22 18 19 oveq12d a = B C 1 st a 2 nd a = 1 st B C 2 nd B C
23 22 eqeq2d a = B C A = 1 st a 2 nd a A = 1 st B C 2 nd B C
24 21 23 anbi12d a = B C 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a 1 st B C gcd 2 nd B C = 1 A = 1 st B C 2 nd B C
25 24 riota2 B C × ∃! a × 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a 1 st B C gcd 2 nd B C = 1 A = 1 st B C 2 nd B C ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = B C
26 16 17 25 syl2anc A B C 1 st B C gcd 2 nd B C = 1 A = 1 st B C 2 nd B C ι a × | 1 st a gcd 2 nd a = 1 A = 1 st a 2 nd a = B C
27 op1stg B C 1 st B C = B
28 op2ndg B C 2 nd B C = C
29 27 28 oveq12d B C 1 st B C gcd 2 nd B C = B gcd C
30 29 3adant1 A B C 1 st B C gcd 2 nd B C = B gcd C
31 30 eqeq1d A B C 1 st B C gcd 2 nd B C = 1 B gcd C = 1
32 27 3adant1 A B C 1 st B C = B
33 28 3adant1 A B C 2 nd B C = C
34 32 33 oveq12d A B C 1 st B C 2 nd B C = B C
35 34 eqeq2d A B C A = 1 st B C 2 nd B C A = B C
36 31 35 anbi12d A B C 1 st B C gcd 2 nd B C = 1 A = 1 st B C 2 nd B C B gcd C = 1 A = B C
37 14 26 36 3bitr2rd A B C B gcd C = 1 A = B C numer A = B denom A = C