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

Theorem bezout 12595
Description: Bézout's identity: For any integers  A and  B, there are integers  x ,  y such that  ( A  gcd  B )  =  A  x.  x  +  B  x.  y. (Contributed by Mario Carneiro, 22-Feb-2014.)
Assertion
Ref Expression
bezout  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) )
Distinct variable groups:    x, y, A    x, B, y

Proof of Theorem bezout
StepHypRef Expression
1 eqeq1 2259 . . . . . . . 8  |-  ( z  =  t  ->  (
z  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  x )  +  ( B  x.  y ) ) ) )
212rexbidv 2548 . . . . . . 7  |-  ( z  =  t  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x )  +  ( B  x.  y
) )  <->  E. x  e.  ZZ  E. y  e.  ZZ  t  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) ) )
3 oveq2 5718 . . . . . . . . . 10  |-  ( x  =  u  ->  ( A  x.  x )  =  ( A  x.  u ) )
43oveq1d 5725 . . . . . . . . 9  |-  ( x  =  u  ->  (
( A  x.  x
)  +  ( B  x.  y ) )  =  ( ( A  x.  u )  +  ( B  x.  y
) ) )
54eqeq2d 2264 . . . . . . . 8  |-  ( x  =  u  ->  (
t  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  u )  +  ( B  x.  y ) ) ) )
6 oveq2 5718 . . . . . . . . . 10  |-  ( y  =  v  ->  ( B  x.  y )  =  ( B  x.  v ) )
76oveq2d 5726 . . . . . . . . 9  |-  ( y  =  v  ->  (
( A  x.  u
)  +  ( B  x.  y ) )  =  ( ( A  x.  u )  +  ( B  x.  v
) ) )
87eqeq2d 2264 . . . . . . . 8  |-  ( y  =  v  ->  (
t  =  ( ( A  x.  u )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  u )  +  ( B  x.  v ) ) ) )
95, 8cbvrex2v 2712 . . . . . . 7  |-  ( E. x  e.  ZZ  E. y  e.  ZZ  t  =  ( ( A  x.  x )  +  ( B  x.  y
) )  <->  E. u  e.  ZZ  E. v  e.  ZZ  t  =  ( ( A  x.  u
)  +  ( B  x.  v ) ) )
102, 9syl6bb 254 . . . . . 6  |-  ( z  =  t  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x )  +  ( B  x.  y
) )  <->  E. u  e.  ZZ  E. v  e.  ZZ  t  =  ( ( A  x.  u
)  +  ( B  x.  v ) ) ) )
1110cbvrabv 2726 . . . . 5  |-  { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) }  =  { t  e.  NN  |  E. u  e.  ZZ  E. v  e.  ZZ  t  =  ( ( A  x.  u
)  +  ( B  x.  v ) ) }
12 simpll 733 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  ->  A  e.  ZZ )
13 simplr 734 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  ->  B  e.  ZZ )
14 eqid 2253 . . . . 5  |-  sup ( { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x )  +  ( B  x.  y
) ) } ,  RR ,  `'  <  )  =  sup ( { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x )  +  ( B  x.  y
) ) } ,  RR ,  `'  <  )
15 simpr 449 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  ->  -.  ( A  =  0  /\  B  =  0 ) )
1611, 12, 13, 14, 15bezoutlem4 12594 . . . 4  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  ->  ( A  gcd  B )  e.  { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) } )
17 eqeq1 2259 . . . . . . 7  |-  ( z  =  ( A  gcd  B )  ->  ( z  =  ( ( A  x.  x )  +  ( B  x.  y
) )  <->  ( A  gcd  B )  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) ) )
18172rexbidv 2548 . . . . . 6  |-  ( z  =  ( A  gcd  B )  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x
)  +  ( B  x.  y ) )  <->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) ) )
1918elrab 2860 . . . . 5  |-  ( ( A  gcd  B )  e.  { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) }  <->  ( ( A  gcd  B )  e.  NN  /\  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) ) )
2019simprbi 452 . . . 4  |-  ( ( A  gcd  B )  e.  { z  e.  NN  |  E. x  e.  ZZ  E. y  e.  ZZ  z  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) }  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) )
2116, 20syl 17 . . 3  |-  ( ( ( A  e.  ZZ  /\  B  e.  ZZ )  /\  -.  ( A  =  0  /\  B  =  0 ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) )
2221ex 425 . 2  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( -.  ( A  =  0  /\  B  =  0 )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) ) )
23 0z 9914 . . . 4  |-  0  e.  ZZ
24 00id 8867 . . . . 5  |-  ( 0  +  0 )  =  0
25 0cn 8711 . . . . . . 7  |-  0  e.  CC
2625mul01i 8882 . . . . . 6  |-  ( 0  x.  0 )  =  0
2726, 26oveq12i 5722 . . . . 5  |-  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )  =  ( 0  +  0 )
28 gcd0val 12562 . . . . 5  |-  ( 0  gcd  0 )  =  0
2924, 27, 283eqtr4ri 2284 . . . 4  |-  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )
30 oveq2 5718 . . . . . . 7  |-  ( x  =  0  ->  (
0  x.  x )  =  ( 0  x.  0 ) )
3130oveq1d 5725 . . . . . 6  |-  ( x  =  0  ->  (
( 0  x.  x
)  +  ( 0  x.  y ) )  =  ( ( 0  x.  0 )  +  ( 0  x.  y
) ) )
3231eqeq2d 2264 . . . . 5  |-  ( x  =  0  ->  (
( 0  gcd  0
)  =  ( ( 0  x.  x )  +  ( 0  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  y ) ) ) )
33 oveq2 5718 . . . . . . 7  |-  ( y  =  0  ->  (
0  x.  y )  =  ( 0  x.  0 ) )
3433oveq2d 5726 . . . . . 6  |-  ( y  =  0  ->  (
( 0  x.  0 )  +  ( 0  x.  y ) )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) ) )
3534eqeq2d 2264 . . . . 5  |-  ( y  =  0  ->  (
( 0  gcd  0
)  =  ( ( 0  x.  0 )  +  ( 0  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) ) ) )
3632, 35rcla42ev 2829 . . . 4  |-  ( ( 0  e.  ZZ  /\  0  e.  ZZ  /\  (
0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  (
0  gcd  0 )  =  ( ( 0  x.  x )  +  ( 0  x.  y
) ) )
3723, 23, 29, 36mp3an 1282 . . 3  |-  E. x  e.  ZZ  E. y  e.  ZZ  ( 0  gcd  0 )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) )
38 oveq12 5719 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( A  gcd  B )  =  ( 0  gcd  0 ) )
39 oveq1 5717 . . . . . 6  |-  ( A  =  0  ->  ( A  x.  x )  =  ( 0  x.  x ) )
40 oveq1 5717 . . . . . 6  |-  ( B  =  0  ->  ( B  x.  y )  =  ( 0  x.  y ) )
4139, 40oveqan12d 5729 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  x.  x )  +  ( B  x.  y
) )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) ) )
4238, 41eqeq12d 2267 . . . 4  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) ) ) )
43422rexbidv 2548 . . 3  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  E. x  e.  ZZ  E. y  e.  ZZ  ( 0  gcd  0 )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) ) ) )
4437, 43mpbiri 226 . 2  |-  ( ( A  =  0  /\  B  =  0 )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) )
4522, 44pm2.61d2 154 1  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) ) )
Colors of variables: wff set class
Syntax hints:   -. wn 5    -> wi 6    /\ wa 360    = wceq 1619    e. wcel 1621   E.wrex 2510   {crab 2512   `'ccnv 4579  (class class class)co 5710   supcsup 7077   RRcr 8616   0cc0 8617    + caddc 8620    x. cmul 8622    < clt 8747   NNcn 9626   ZZcz 9903    gcd cgcd 12559
This theorem is referenced by:  dvdsgcd  12596  dvdsmulgcd  12607  odbezout  14706  ablfacrp  15136  pgpfac1lem3  15147  znunit  16349  2sqb  20449  ostth3  20619
This theorem was proved from axioms:  ax-1 7  ax-2 8  ax-3 9  ax-mp 10  ax-5 1533  ax-6 1534  ax-7 1535  ax-gen 1536  ax-8 1623  ax-11 1624  ax-13 1625  ax-14 1626  ax-17 1628  ax-12o 1664  ax-10 1678  ax-9 1684  ax-4 1692  ax-16 1926  ax-ext 2234  ax-sep 4038  ax-nul 4046  ax-pow 4082  ax-pr 4108  ax-un 4403  ax-cnex 8673  ax-resscn 8674  ax-1cn 8675  ax-icn 8676  ax-addcl 8677  ax-addrcl 8678  ax-mulcl 8679  ax-mulrcl 8680  ax-mulcom 8681  ax-addass 8682  ax-mulass 8683  ax-distr 8684  ax-i2m1 8685  ax-1ne0 8686  ax-1rid 8687  ax-rnegex 8688  ax-rrecex 8689  ax-cnre 8690  ax-pre-lttri 8691  ax-pre-lttrn 8692  ax-pre-ltadd 8693  ax-pre-mulgt0 8694  ax-pre-sup 8695
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 940  df-3an 941  df-tru 1315  df-ex 1538  df-nf 1540  df-sb 1883  df-eu 2118  df-mo 2119  df-clab 2240  df-cleq 2246  df-clel 2249  df-nfc 2374  df-ne 2414  df-nel 2415  df-ral 2513  df-rex 2514  df-reu 2515  df-rab 2516  df-v 2729  df-sbc 2922  df-csb 3010  df-dif 3081  df-un 3083  df-in 3085  df-ss 3089  df-pss 3091  df-nul 3363  df-if 3471  df-pw 3532  df-sn 3550  df-pr 3551  df-tp 3552  df-op 3553  df-uni 3728  df-iun 3805  df-br 3921  df-opab 3975  df-mpt 3976  df-tr 4011  df-eprel 4198  df-id 4202  df-po 4207  df-so 4208  df-fr 4245  df-we 4247  df-ord 4288  df-on 4289  df-lim 4290  df-suc 4291  df-om 4548  df-xp 4594  df-rel 4595  df-cnv 4596  df-co 4597  df-dm 4598  df-rn 4599  df-res 4600  df-ima 4601  df-fun 4602  df-fn 4603  df-f 4604  df-f1 4605  df-fo 4606  df-f1o 4607  df-fv 4608  df-ov 5713  df-oprab 5714  df-mpt2 5715  df-2nd 5975  df-iota 6143  df-riota 6190  df-recs 6274  df-rdg 6309  df-er 6546  df-en 6750  df-dom 6751  df-sdom 6752  df-sup 7078  df-pnf 8749  df-mnf 8750  df-xr 8751  df-ltxr 8752  df-le 8753  df-sub 8919  df-neg 8920  df-div 9304  df-n 9627  df-2 9684  df-3 9685  df-n0 9845  df-z 9904  df-uz 10110  df-rp 10234  df-fl 10803  df-mod 10852  df-seq 10925  df-exp 10983  df-cj 11461  df-re 11462  df-im 11463  df-sqr 11597  df-abs 11598  df-divides 12406  df-gcd 12560
  Copyright terms: Public domain W3C validator