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

Theorem bezout 12648
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 2262 . . . . . . . 8  |-  ( z  =  t  ->  (
z  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  x )  +  ( B  x.  y ) ) ) )
212rexbidv 2557 . . . . . . 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 5765 . . . . . . . . . 10  |-  ( x  =  u  ->  ( A  x.  x )  =  ( A  x.  u ) )
43oveq1d 5772 . . . . . . . . 9  |-  ( x  =  u  ->  (
( A  x.  x
)  +  ( B  x.  y ) )  =  ( ( A  x.  u )  +  ( B  x.  y
) ) )
54eqeq2d 2267 . . . . . . . 8  |-  ( x  =  u  ->  (
t  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  u )  +  ( B  x.  y ) ) ) )
6 oveq2 5765 . . . . . . . . . 10  |-  ( y  =  v  ->  ( B  x.  y )  =  ( B  x.  v ) )
76oveq2d 5773 . . . . . . . . 9  |-  ( y  =  v  ->  (
( A  x.  u
)  +  ( B  x.  y ) )  =  ( ( A  x.  u )  +  ( B  x.  v
) ) )
87eqeq2d 2267 . . . . . . . 8  |-  ( y  =  v  ->  (
t  =  ( ( A  x.  u )  +  ( B  x.  y ) )  <->  t  =  ( ( A  x.  u )  +  ( B  x.  v ) ) ) )
95, 8cbvrex2v 2725 . . . . . . 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 2739 . . . . 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 2256 . . . . 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 12647 . . . 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 2262 . . . . . . 7  |-  ( z  =  ( A  gcd  B )  ->  ( z  =  ( ( A  x.  x )  +  ( B  x.  y
) )  <->  ( A  gcd  B )  =  ( ( A  x.  x
)  +  ( B  x.  y ) ) ) )
18172rexbidv 2557 . . . . . 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 2874 . . . . 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 9967 . . . 4  |-  0  e.  ZZ
24 00id 8920 . . . . 5  |-  ( 0  +  0 )  =  0
25 0cn 8764 . . . . . . 7  |-  0  e.  CC
2625mul01i 8935 . . . . . 6  |-  ( 0  x.  0 )  =  0
2726, 26oveq12i 5769 . . . . 5  |-  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )  =  ( 0  +  0 )
28 gcd0val 12615 . . . . 5  |-  ( 0  gcd  0 )  =  0
2924, 27, 283eqtr4ri 2287 . . . 4  |-  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )
30 oveq2 5765 . . . . . . 7  |-  ( x  =  0  ->  (
0  x.  x )  =  ( 0  x.  0 ) )
3130oveq1d 5772 . . . . . 6  |-  ( x  =  0  ->  (
( 0  x.  x
)  +  ( 0  x.  y ) )  =  ( ( 0  x.  0 )  +  ( 0  x.  y
) ) )
3231eqeq2d 2267 . . . . 5  |-  ( x  =  0  ->  (
( 0  gcd  0
)  =  ( ( 0  x.  x )  +  ( 0  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  y ) ) ) )
33 oveq2 5765 . . . . . . 7  |-  ( y  =  0  ->  (
0  x.  y )  =  ( 0  x.  0 ) )
3433oveq2d 5773 . . . . . 6  |-  ( y  =  0  ->  (
( 0  x.  0 )  +  ( 0  x.  y ) )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) ) )
3534eqeq2d 2267 . . . . 5  |-  ( y  =  0  ->  (
( 0  gcd  0
)  =  ( ( 0  x.  0 )  +  ( 0  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) ) ) )
3632, 35rcla42ev 2843 . . . 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 5766 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( A  gcd  B )  =  ( 0  gcd  0 ) )
39 oveq1 5764 . . . . . 6  |-  ( A  =  0  ->  ( A  x.  x )  =  ( 0  x.  x ) )
40 oveq1 5764 . . . . . 6  |-  ( B  =  0  ->  ( B  x.  y )  =  ( 0  x.  y ) )
4139, 40oveqan12d 5776 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  x.  x )  +  ( B  x.  y
) )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) ) )
4238, 41eqeq12d 2270 . . . 4  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  gcd  B )  =  ( ( A  x.  x )  +  ( B  x.  y ) )  <->  ( 0  gcd  0 )  =  ( ( 0  x.  x
)  +  ( 0  x.  y ) ) ) )
43422rexbidv 2557 . . 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 2517   {crab 2519   `'ccnv 4625  (class class class)co 5757   supcsup 7126   RRcr 8669   0cc0 8670    + caddc 8673    x. cmul 8675    < clt 8800   NNcn 9679   ZZcz 9956    gcd cgcd 12612
This theorem is referenced by:  dvdsgcd  12649  dvdsmulgcd  12660  odbezout  14798  ablfacrp  15228  pgpfac1lem3  15239  znunit  16444  2sqb  20544  ostth3  20714
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 1927  ax-ext 2237  ax-sep 4081  ax-nul 4089  ax-pow 4126  ax-pr 4152  ax-un 4449  ax-cnex 8726  ax-resscn 8727  ax-1cn 8728  ax-icn 8729  ax-addcl 8730  ax-addrcl 8731  ax-mulcl 8732  ax-mulrcl 8733  ax-mulcom 8734  ax-addass 8735  ax-mulass 8736  ax-distr 8737  ax-i2m1 8738  ax-1ne0 8739  ax-1rid 8740  ax-rnegex 8741  ax-rrecex 8742  ax-cnre 8743  ax-pre-lttri 8744  ax-pre-lttrn 8745  ax-pre-ltadd 8746  ax-pre-mulgt0 8747  ax-pre-sup 8748
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 1884  df-eu 2121  df-mo 2122  df-clab 2243  df-cleq 2249  df-clel 2252  df-nfc 2381  df-ne 2421  df-nel 2422  df-ral 2520  df-rex 2521  df-reu 2522  df-rab 2523  df-v 2742  df-sbc 2936  df-csb 3024  df-dif 3097  df-un 3099  df-in 3101  df-ss 3108  df-pss 3110  df-nul 3398  df-if 3507  df-pw 3568  df-sn 3587  df-pr 3588  df-tp 3589  df-op 3590  df-uni 3769  df-iun 3848  df-br 3964  df-opab 4018  df-mpt 4019  df-tr 4054  df-eprel 4242  df-id 4246  df-po 4251  df-so 4252  df-fr 4289  df-we 4291  df-ord 4332  df-on 4333  df-lim 4334  df-suc 4335  df-om 4594  df-xp 4640  df-rel 4641  df-cnv 4642  df-co 4643  df-dm 4644  df-rn 4645  df-res 4646  df-ima 4647  df-fun 4648  df-fn 4649  df-f 4650  df-f1 4651  df-fo 4652  df-f1o 4653  df-fv 4654  df-ov 5760  df-oprab 5761  df-mpt2 5762  df-2nd 6022  df-iota 6190  df-riota 6237  df-recs 6321  df-rdg 6356  df-er 6593  df-en 6797  df-dom 6798  df-sdom 6799  df-sup 7127  df-pnf 8802  df-mnf 8803  df-xr 8804  df-ltxr 8805  df-le 8806  df-sub 8972  df-neg 8973  df-div 9357  df-n 9680  df-2 9737  df-3 9738  df-n0 9898  df-z 9957  df-uz 10163  df-rp 10287  df-fl 10856  df-mod 10905  df-seq 10978  df-exp 11036  df-cj 11514  df-re 11515  df-im 11516  df-sqr 11650  df-abs 11651  df-divides 12459  df-gcd 12613
  Copyright terms: Public domain W3C validator