Table of ContentsTable of Contents Mathbox for Paul Chapman < Previous   Next >
Related theorems
Unicode version

Theorem eucalgval2 13750
Description: The value of the step function E for Euclid's Algorithm on an ordered pair. (Contributed by Paul Chapman, 31-Mar-2011.)
Hypothesis
Ref Expression
eucalgval.1 |- E = {<.x, y>. | (x e. (NN0 X. NN0) /\ y = if((2nd` x) = 0, x, <.(2nd` x), ( mod ` x)>.))}
Assertion
Ref Expression
eucalgval2 |- ((M e. NN0 /\ N e. NN0) -> (E` <.M, N>.) = if(N = 0, <.M, N>., <.N, (M mod N)>.))
Distinct variable group:   x,y

Proof of Theorem eucalgval2
StepHypRef Expression
1 opelxpi 4040 . . 3 |- ((M e. NN0 /\ N e. NN0) -> <.M, N>. e. (NN0 X. NN0))
2 eucalgval.1 . . . 4 |- E = {<.x, y>. | (x e. (NN0 X. NN0) /\ y = if((2nd` x) = 0, x, <.(2nd` x), ( mod ` x)>.))}
32eucalgval 13749 . . 3 |- (<.M, N>. e. (NN0 X. NN0) -> (E` <.M, N>.) = if((2nd`
<.M, N>.) = 0, <.M, N>., <.(2nd` <.M, N>.), ( mod ` <.M, N>.)>.))
41, 3syl 12 . 2 |- ((M e. NN0 /\ N e. NN0) -> (E` <.M, N>.) = if((2nd` <.M, N>.) = 0, <.M, N>., <.(2nd` <.M, N>.), ( mod ` <.M, N>.)>.))
5 op2ndg 5029 . . . 4 |- ((M e. NN0 /\ N e. NN0) -> (2nd` <.M, N>.) = N)
65eqeq1d 1892 . . 3 |- ((M e. NN0 /\ N e. NN0) -> ((2nd` <.M, N>.) = 0 <-> N = 0))
75eqcomd 1889 . . . . 5 |- ((M e. NN0 /\ N e. NN0) -> N = (2nd` <.M, N>.))
8 df-opr 4886 . . . . . 6 |- (M mod N) = ( mod ` <.M, N>.)
98a1i 8 . . . . 5 |- ((M e. NN0 /\ N e. NN0) -> (M mod N) = ( mod ` <.M, N>.))
107, 9opeq12d 3166 . . . 4 |- ((M e. NN0 /\ N e. NN0) -> <.N, (M mod N)>. = <.(2nd` <.M, N>.), ( mod ` <.M, N>.)>.)
1110eqcomd 1889 . . 3 |- ((M e. NN0 /\ N e. NN0) -> <.(2nd` <.M, N>.), ( mod ` <.M, N>.)>. = <.N, (M mod N)>.)
126, 11ifbieq2d 13594 . 2 |- ((M e. NN0 /\ N e. NN0) -> if((2nd` <.M, N>.) = 0, <.M, N>., <.(2nd` <.M, N>.), ( mod ` <.M, N>.)>.) = if(N = 0, <.M, N>., <.N, (M mod N)>.))
134, 12eqtrd 1925 1 |- ((M e. NN0 /\ N e. NN0) -> (E` <.M, N>.) = if(N = 0, <.M, N>., <.N, (M mod N)>.))
Colors of variables: wff set class
Syntax hints:   -> wi 3   /\ wa 240   = wceq 1298   e. wcel 1300  ifcif 2982  <.cop 3046  {copab 3395   X. cxp 3984  ` cfv 3998  (class class class)co 4884  2ndc2nd 5019  0cc0 6386  NN0cn0 6450   mod cmo 7499
This theorem is referenced by:  eucalgf 13751  eucalginv 13752  eucalglt 13753
This theorem was proved from axioms:  ax-1 4  ax-2 5  ax-3 6  ax-mp 7  ax-7 1304  ax-gen 1305  ax-8 1306  ax-9 1307  ax-10 1308  ax-11 1309  ax-12 1310  ax-13 1311  ax-14 1312  ax-17 1317  ax-4 1319  ax-5o 1321  ax-6o 1324  ax-9o 1481  ax-10o 1500  ax-16 1580  ax-11o 1588  ax-ext 1865  ax-sep 3438  ax-nul 3445  ax-pow 3481  ax-pr 3524  ax-un 3790
This theorem depends on definitions:  df-bi 164  df-or 241  df-an 242  df-ex 1327  df-sb 1536  df-eu 1775  df-mo 1776  df-clab 1872  df-cleq 1877  df-clel 1880  df-ne 2019  df-ral 2109  df-rex 2110  df-v 2294  df-dif 2597  df-un 2600  df-in 2603  df-ss 2605  df-nul 2876  df-if 2983  df-pw 3035  df-sn 3049  df-pr 3050  df-op 3053  df-uni 3178  df-br 3339  df-opab 3396  df-id 3586  df-xp 4000  df-rel 4001  df-cnv 4002  df-co 4003  df-dm 4004  df-rn 4005  df-res 4006  df-ima 4007  df-fun 4008  df-fv 4014  df-opr 4886  df-2nd 5021
Copyright terms: Public domain