MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  qnumdenbi Structured version   Unicode version

Theorem qnumdenbi 13138
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.)
Assertion
Ref Expression
qnumdenbi  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( ( B  gcd  C )  =  1  /\  A  =  ( B  /  C ) )  <-> 
( (numer `  A
)  =  B  /\  (denom `  A )  =  C ) ) )

Proof of Theorem qnumdenbi
Dummy variable  a is distinct from all other variables.
StepHypRef Expression
1 qredeu 13109 . . . . . . 7  |-  ( A  e.  QQ  ->  E! a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )
2 riotacl 6566 . . . . . . 7  |-  ( E! a  e.  ( ZZ 
X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) )  ->  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  e.  ( ZZ 
X.  NN ) )
3 1st2nd2 6388 . . . . . . 7  |-  ( (
iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  e.  ( ZZ 
X.  NN )  -> 
( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a )  /  ( 2nd `  a ) ) ) )  =  <. ( 1st `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) ,  ( 2nd `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) >. )
41, 2, 33syl 19 . . . . . 6  |-  ( A  e.  QQ  ->  ( iota_ a  e.  ( ZZ 
X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  =  <. ( 1st `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) ,  ( 2nd `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) >. )
5 qnumval 13131 . . . . . . 7  |-  ( A  e.  QQ  ->  (numer `  A )  =  ( 1st `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) )
6 qdenval 13132 . . . . . . 7  |-  ( A  e.  QQ  ->  (denom `  A )  =  ( 2nd `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) )
75, 6opeq12d 3994 . . . . . 6  |-  ( A  e.  QQ  ->  <. (numer `  A ) ,  (denom `  A ) >.  =  <. ( 1st `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) ,  ( 2nd `  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) ) ) >. )
84, 7eqtr4d 2473 . . . . 5  |-  ( A  e.  QQ  ->  ( iota_ a  e.  ( ZZ 
X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  =  <. (numer `  A ) ,  (denom `  A ) >. )
98eqeq1d 2446 . . . 4  |-  ( A  e.  QQ  ->  (
( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a )  /  ( 2nd `  a ) ) ) )  =  <. B ,  C >.  <->  <. (numer `  A ) ,  (denom `  A ) >.  =  <. B ,  C >. )
)
1093ad2ant1 979 . . 3  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a )  /  ( 2nd `  a ) ) ) )  =  <. B ,  C >.  <->  <. (numer `  A ) ,  (denom `  A ) >.  =  <. B ,  C >. )
)
11 fvex 5744 . . . 4  |-  (numer `  A )  e.  _V
12 fvex 5744 . . . 4  |-  (denom `  A )  e.  _V
1311, 12opth 4437 . . 3  |-  ( <.
(numer `  A ) ,  (denom `  A ) >.  =  <. B ,  C >.  <-> 
( (numer `  A
)  =  B  /\  (denom `  A )  =  C ) )
1410, 13syl6rbb 255 . 2  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( (numer `  A
)  =  B  /\  (denom `  A )  =  C )  <->  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  =  <. B ,  C >. ) )
15 opelxpi 4912 . . . 4  |-  ( ( B  e.  ZZ  /\  C  e.  NN )  -> 
<. B ,  C >.  e.  ( ZZ  X.  NN ) )
16153adant1 976 . . 3  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  <. B ,  C >.  e.  ( ZZ 
X.  NN ) )
1713ad2ant1 979 . . 3  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  E! a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )
18 fveq2 5730 . . . . . . 7  |-  ( a  =  <. B ,  C >.  ->  ( 1st `  a
)  =  ( 1st `  <. B ,  C >. ) )
19 fveq2 5730 . . . . . . 7  |-  ( a  =  <. B ,  C >.  ->  ( 2nd `  a
)  =  ( 2nd `  <. B ,  C >. ) )
2018, 19oveq12d 6101 . . . . . 6  |-  ( a  =  <. B ,  C >.  ->  ( ( 1st `  a )  gcd  ( 2nd `  a ) )  =  ( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. ) ) )
2120eqeq1d 2446 . . . . 5  |-  ( a  =  <. B ,  C >.  ->  ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  <-> 
( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. )
)  =  1 ) )
2218, 19oveq12d 6101 . . . . . 6  |-  ( a  =  <. B ,  C >.  ->  ( ( 1st `  a )  /  ( 2nd `  a ) )  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. ) ) )
2322eqeq2d 2449 . . . . 5  |-  ( a  =  <. B ,  C >.  ->  ( A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) )  <->  A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. )
) ) )
2421, 23anbi12d 693 . . . 4  |-  ( a  =  <. B ,  C >.  ->  ( ( ( ( 1st `  a
)  gcd  ( 2nd `  a ) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) )  <-> 
( ( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. ) )  =  1  /\  A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. )
) ) ) )
2524riota2 6574 . . 3  |-  ( (
<. B ,  C >.  e.  ( ZZ  X.  NN )  /\  E! a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  ->  ( (
( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. )
)  =  1  /\  A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. ) ) )  <->  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  =  <. B ,  C >. ) )
2616, 17, 25syl2anc 644 . 2  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( ( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. ) )  =  1  /\  A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. )
) )  <->  ( iota_ a  e.  ( ZZ  X.  NN ) ( ( ( 1st `  a )  gcd  ( 2nd `  a
) )  =  1  /\  A  =  ( ( 1st `  a
)  /  ( 2nd `  a ) ) ) )  =  <. B ,  C >. ) )
27 op1stg 6361 . . . . . 6  |-  ( ( B  e.  ZZ  /\  C  e.  NN )  ->  ( 1st `  <. B ,  C >. )  =  B )
28 op2ndg 6362 . . . . . 6  |-  ( ( B  e.  ZZ  /\  C  e.  NN )  ->  ( 2nd `  <. B ,  C >. )  =  C )
2927, 28oveq12d 6101 . . . . 5  |-  ( ( B  e.  ZZ  /\  C  e.  NN )  ->  ( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. )
)  =  ( B  gcd  C ) )
30293adant1 976 . . . 4  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. )
)  =  ( B  gcd  C ) )
3130eqeq1d 2446 . . 3  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. )
)  =  1  <->  ( B  gcd  C )  =  1 ) )
32273adant1 976 . . . . 5  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  ( 1st `  <. B ,  C >. )  =  B )
33283adant1 976 . . . . 5  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  ( 2nd `  <. B ,  C >. )  =  C )
3432, 33oveq12d 6101 . . . 4  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. )
)  =  ( B  /  C ) )
3534eqeq2d 2449 . . 3  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  ( A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. ) )  <->  A  =  ( B  /  C
) ) )
3631, 35anbi12d 693 . 2  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( ( ( 1st `  <. B ,  C >. )  gcd  ( 2nd `  <. B ,  C >. ) )  =  1  /\  A  =  ( ( 1st `  <. B ,  C >. )  /  ( 2nd `  <. B ,  C >. )
) )  <->  ( ( B  gcd  C )  =  1  /\  A  =  ( B  /  C
) ) ) )
3714, 26, 363bitr2rd 275 1  |-  ( ( A  e.  QQ  /\  B  e.  ZZ  /\  C  e.  NN )  ->  (
( ( B  gcd  C )  =  1  /\  A  =  ( B  /  C ) )  <-> 
( (numer `  A
)  =  B  /\  (denom `  A )  =  C ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 178    /\ wa 360    /\ w3a 937    = wceq 1653    e. wcel 1726   E!wreu 2709   <.cop 3819    X. cxp 4878   ` cfv 5456  (class class class)co 6083   1stc1st 6349   2ndc2nd 6350   iota_crio 6544   1c1 8993    / cdiv 9679   NNcn 10002   ZZcz 10284   QQcq 10576    gcd cgcd 13008  numercnumer 13127  denomcdenom 13128
This theorem is referenced by:  qnumdencoprm  13139  qeqnumdivden  13140  divnumden  13142  numdensq  13148  numdenneg  24162  qqh0  24370  qqh1  24371
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-cnex 9048  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069  ax-pre-sup 9070
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-1st 6351  df-2nd 6352  df-riota 6551  df-recs 6635  df-rdg 6670  df-er 6907  df-en 7112  df-dom 7113  df-sdom 7114  df-sup 7448  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-div 9680  df-nn 10003  df-2 10060  df-3 10061  df-n0 10224  df-z 10285  df-uz 10491  df-q 10577  df-rp 10615  df-fl 11204  df-mod 11253  df-seq 11326  df-exp 11385  df-cj 11906  df-re 11907  df-im 11908  df-sqr 12042  df-abs 12043  df-dvds 12855  df-gcd 13009  df-numer 13129  df-denom 13130
  Copyright terms: Public domain W3C validator