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

Theorem eucalgval2 12751
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 447 . . . 4  |-  ( ( x  =  M  /\  y  =  N )  ->  y  =  N )
21eqeq1d 2291 . . 3  |-  ( ( x  =  M  /\  y  =  N )  ->  ( y  =  0  <-> 
N  =  0 ) )
3 opeq12 3798 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. x ,  y >.  =  <. M ,  N >. )
4 oveq12 5867 . . . 4  |-  ( ( x  =  M  /\  y  =  N )  ->  ( x  mod  y
)  =  ( M  mod  N ) )
51, 4opeq12d 3804 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. y ,  ( x  mod  y ) >.  =  <. N ,  ( M  mod  N )
>. )
62, 3, 5ifbieq12d 3587 . 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 4237 . . 3  |-  <. M ,  N >.  e.  _V
9 opex 4237 . . 3  |-  <. N , 
( M  mod  N
) >.  e.  _V
108, 9ifex 3623 . 2  |-  if ( N  =  0 , 
<. M ,  N >. , 
<. N ,  ( M  mod  N ) >.
)  e.  _V
116, 7, 10ovmpt2a 5978 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 4    /\ wa 358    = wceq 1623    e. wcel 1684   ifcif 3565   <.cop 3643  (class class class)co 5858    e. cmpt2 5860   0cc0 8737   NN0cn0 9965    mod cmo 10973
This theorem is referenced by:  eucalgval  12752
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pr 4214
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-ral 2548  df-rex 2549  df-rab 2552  df-v 2790  df-sbc 2992  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3456  df-if 3566  df-sn 3646  df-pr 3647  df-op 3649  df-uni 3828  df-br 4024  df-opab 4078  df-id 4309  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-iota 5219  df-fun 5257  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863
  Copyright terms: Public domain W3C validator