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

Theorem eucalgval2 12767
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 2304 . . 3  |-  ( ( x  =  M  /\  y  =  N )  ->  ( y  =  0  <-> 
N  =  0 ) )
3 opeq12 3814 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. x ,  y >.  =  <. M ,  N >. )
4 oveq12 5883 . . . 4  |-  ( ( x  =  M  /\  y  =  N )  ->  ( x  mod  y
)  =  ( M  mod  N ) )
51, 4opeq12d 3820 . . 3  |-  ( ( x  =  M  /\  y  =  N )  -> 
<. y ,  ( x  mod  y ) >.  =  <. N ,  ( M  mod  N )
>. )
62, 3, 5ifbieq12d 3600 . 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 4253 . . 3  |-  <. M ,  N >.  e.  _V
9 opex 4253 . . 3  |-  <. N , 
( M  mod  N
) >.  e.  _V
108, 9ifex 3636 . 2  |-  if ( N  =  0 , 
<. M ,  N >. , 
<. N ,  ( M  mod  N ) >.
)  e.  _V
116, 7, 10ovmpt2a 5994 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 1632    e. wcel 1696   ifcif 3578   <.cop 3656  (class class class)co 5874    e. cmpt2 5876   0cc0 8753   NN0cn0 9981    mod cmo 10989
This theorem is referenced by:  eucalgval  12768
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pr 4230
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-ral 2561  df-rex 2562  df-rab 2565  df-v 2803  df-sbc 3005  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-nul 3469  df-if 3579  df-sn 3659  df-pr 3660  df-op 3662  df-uni 3844  df-br 4040  df-opab 4094  df-id 4325  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-iota 5235  df-fun 5273  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879
  Copyright terms: Public domain W3C validator