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

Theorem bezout 12669
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 2559 . . . . . . 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 5786 . . . . . . . . . 10  |-  ( x  =  u  ->  ( A  x.  x )  =  ( A  x.  u ) )
43oveq1d 5793 . . . . . . . . 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 5786 . . . . . . . . . 10  |-  ( y  =  v  ->  ( B  x.  y )  =  ( B  x.  v ) )
76oveq2d 5794 . . . . . . . . 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 2742 . . . . . . 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 2756 . . . . 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 12668 . . . 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 2559 . . . . . 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 2891 . . . . 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 9988 . . . 4  |-  0  e.  ZZ
24 00id 8941 . . . . 5  |-  ( 0  +  0 )  =  0
25 0cn 8785 . . . . . . 7  |-  0  e.  CC
2625mul01i 8956 . . . . . 6  |-  ( 0  x.  0 )  =  0
2726, 26oveq12i 5790 . . . . 5  |-  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )  =  ( 0  +  0 )
28 gcd0val 12636 . . . . 5  |-  ( 0  gcd  0 )  =  0
2924, 27, 283eqtr4ri 2287 . . . 4  |-  ( 0  gcd  0 )  =  ( ( 0  x.  0 )  +  ( 0  x.  0 ) )
30 oveq2 5786 . . . . . . 7  |-  ( x  =  0  ->  (
0  x.  x )  =  ( 0  x.  0 ) )
3130oveq1d 5793 . . . . . 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 5786 . . . . . . 7  |-  ( y  =  0  ->  (
0  x.  y )  =  ( 0  x.  0 ) )
3433oveq2d 5794 . . . . . 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 2860 . . . 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 5787 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( A  gcd  B )  =  ( 0  gcd  0 ) )
39 oveq1 5785 . . . . . 6  |-  ( A  =  0  ->  ( A  x.  x )  =  ( 0  x.  x ) )
40 oveq1 5785 . . . . . 6  |-  ( B  =  0  ->  ( B  x.  y )  =  ( 0  x.  y ) )
4139, 40oveqan12d 5797 . . . . 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 2559 . . 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 2520   `'ccnv 4646  (class class class)co 5778   supcsup 7147   RRcr 8690   0cc0 8691    + caddc 8694    x. cmul 8696    < clt 8821   NNcn 9700   ZZcz 9977    gcd cgcd 12633
This theorem is referenced by:  dvdsgcd  12670  dvdsmulgcd  12681  odbezout  14819  ablfacrp  15249  pgpfac1lem3  15260  znunit  16465  2sqb  20565  ostth3  20735
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 4101  ax-nul 4109  ax-pow 4146  ax-pr 4172  ax-un 4470  ax-cnex 8747  ax-resscn 8748  ax-1cn 8749  ax-icn 8750  ax-addcl 8751  ax-addrcl 8752  ax-mulcl 8753  ax-mulrcl 8754  ax-mulcom 8755  ax-addass 8756  ax-mulass 8757  ax-distr 8758  ax-i2m1 8759  ax-1ne0 8760  ax-1rid 8761  ax-rnegex 8762  ax-rrecex 8763  ax-cnre 8764  ax-pre-lttri 8765  ax-pre-lttrn 8766  ax-pre-ltadd 8767  ax-pre-mulgt0 8768  ax-pre-sup 8769
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 2521  df-rex 2522  df-reu 2523  df-rmo 2524  df-rab 2525  df-v 2759  df-sbc 2953  df-csb 3043  df-dif 3116  df-un 3118  df-in 3120  df-ss 3127  df-pss 3129  df-nul 3417  df-if 3526  df-pw 3587  df-sn 3606  df-pr 3607  df-tp 3608  df-op 3609  df-uni 3788  df-iun 3867  df-br 3984  df-opab 4038  df-mpt 4039  df-tr 4074  df-eprel 4263  df-id 4267  df-po 4272  df-so 4273  df-fr 4310  df-we 4312  df-ord 4353  df-on 4354  df-lim 4355  df-suc 4356  df-om 4615  df-xp 4661  df-rel 4662  df-cnv 4663  df-co 4664  df-dm 4665  df-rn 4666  df-res 4667  df-ima 4668  df-fun 4669  df-fn 4670  df-f 4671  df-f1 4672  df-fo 4673  df-f1o 4674  df-fv 4675  df-ov 5781  df-oprab 5782  df-mpt2 5783  df-2nd 6043  df-iota 6211  df-riota 6258  df-recs 6342  df-rdg 6377  df-er 6614  df-en 6818  df-dom 6819  df-sdom 6820  df-sup 7148  df-pnf 8823  df-mnf 8824  df-xr 8825  df-ltxr 8826  df-le 8827  df-sub 8993  df-neg 8994  df-div 9378  df-n 9701  df-2 9758  df-3 9759  df-n0 9919  df-z 9978  df-uz 10184  df-rp 10308  df-fl 10877  df-mod 10926  df-seq 10999  df-exp 11057  df-cj 11535  df-re 11536  df-im 11537  df-sqr 11671  df-abs 11672  df-divides 12480  df-gcd 12634
  Copyright terms: Public domain W3C validator