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

Theorem eucalgval2 12714
Description: The value of the step function  E for Euclid's Algorithm on an ordered pair. (Contributed by Paul Chapman, 31-Mar-2011.) (Revised by Mario Carneiro, 28-May-2014.)
Hypothesis
Ref Expression
eucalgval.1  |-  E  =  ( x  e.  NN0 ,  y  e.  NN0  |->  if ( y  =  0 , 
<. x ,  y >. ,  <. y ,  ( x  mod  y )
>. ) )
Assertion
Ref Expression
eucalgval2  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M E N )  =  if ( N  =  0 , 
<. M ,  N >. , 
<. N ,  ( M  mod  N ) >.
) )
Distinct variable groups:    x, y, M    x, N, y
Allowed substitution hints:    E( x, y)

Proof of Theorem eucalgval2
StepHypRef Expression
1 simpr 449 . . . 4  |-  ( ( x  =  M  /\  y  =  N )  ->  y  =  N )
21eqeq1d 2266 . . 3  |-  ( ( x  =  M  /\  y  =  N )  ->  ( y  =  0  <-> 
N  =  0 ) )
3 opeq12 3772 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. x ,  y >.  =  <. M ,  N >. )
4 oveq12 5801 . . . 4  |-  ( ( x  =  M  /\  y  =  N )  ->  ( x  mod  y
)  =  ( M  mod  N ) )
51, 4opeq12d 3778 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. y ,  ( x  mod  y ) >.  =  <. N ,  ( M  mod  N )
>. )
62, 3, 5ifbieq12d 3561 . 2  |-  ( ( x  =  M  /\  y  =  N )  ->  if ( y  =  0 ,  <. x ,  y >. ,  <. y ,  ( x  mod  y ) >. )  =  if ( N  =  0 ,  <. M ,  N >. ,  <. N , 
( M  mod  N
) >. ) )
7 eucalgval.1 . 2  |-  E  =  ( x  e.  NN0 ,  y  e.  NN0  |->  if ( y  =  0 , 
<. x ,  y >. ,  <. y ,  ( x  mod  y )
>. ) )
8 opex 4209 . . 3  |-  <. M ,  N >.  e.  _V
9 opex 4209 . . 3  |-  <. N , 
( M  mod  N
) >.  e.  _V
108, 9ifex 3597 . 2  |-  if ( N  =  0 , 
<. M ,  N >. , 
<. N ,  ( M  mod  N ) >.
)  e.  _V
116, 7, 10ovmpt2a 5912 1  |-  ( ( M  e.  NN0  /\  N  e.  NN0 )  -> 
( M E N )  =  if ( N  =  0 , 
<. M ,  N >. , 
<. N ,  ( M  mod  N ) >.
) )
Colors of variables: wff set class
Syntax hints:    -> wi 6    /\ wa 360    = wceq 1619    e. wcel 1621   ifcif 3539   <.cop 3617  (class class class)co 5792    e. cmpt2 5794   0cc0 8705   NN0cn0 9933    mod cmo 10940
This theorem is referenced by:  eucalgval  12715
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-14 1626  ax-17 1628  ax-12o 1664  ax-10 1678  ax-9 1684  ax-4 1692  ax-16 1927  ax-ext 2239  ax-sep 4115  ax-nul 4123  ax-pr 4186
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3an 941  df-tru 1315  df-ex 1538  df-nf 1540  df-sb 1884  df-eu 2122  df-mo 2123  df-clab 2245  df-cleq 2251  df-clel 2254  df-nfc 2383  df-ne 2423  df-ral 2523  df-rex 2524  df-rab 2527  df-v 2765  df-sbc 2967  df-dif 3130  df-un 3132  df-in 3134  df-ss 3141  df-nul 3431  df-if 3540  df-sn 3620  df-pr 3621  df-op 3623  df-uni 3802  df-br 3998  df-opab 4052  df-id 4281  df-xp 4675  df-rel 4676  df-cnv 4677  df-co 4678  df-dm 4679  df-rn 4680  df-res 4681  df-ima 4682  df-fun 4683  df-fv 4689  df-ov 5795  df-oprab 5796  df-mpt2 5797
  Copyright terms: Public domain W3C validator